Geen cache-versie.

Caching uitgeschakeld. Standaardinstelling voor deze pagina:ingeschakeld (code LNG204)
Als het scherm te langzaam is, kunt u de gebruikersmodus uitschakelen om de cacheversie te bekijken.
java.util

Class AbstractMap. SimpleImmutableEntry<K,V>

  • All Implemented Interfaces:
    Serializable, Map.Entry<K,V>
    Enclosing class:
    AbstractMap<K,V>

    public static class AbstractMap.SimpleImmutableEntry<K,V>
    extends Object
    implements Map.Entry<K,V>, Serializable
    An Entry maintaining an immutable key and value. This class does not support method setValue. This class may be convenient in methods that return thread-safe snapshots of key-value mappings.
    Since:
    1.6
    See Also:
    Serialized Form
    • Constructor Detail

      • AbstractMap.SimpleImmutableEntry

        public AbstractMap.SimpleImmutableEntry(K key,
                                        V value)
        Creates an entry representing a mapping from the specified key to the specified value.
        Parameters:
        key - the key represented by this entry
        value - the value represented by this entry
      • AbstractMap.SimpleImmutableEntry

        public AbstractMap.SimpleImmutableEntry(Map.Entry<? extends K,? extends V> entry)
        Creates an entry representing the same mapping as the specified entry.
        Parameters:
        entry - the entry to copy
    • Method Detail

      • getKey

        public K getKey()
        Returns the key corresponding to this entry.
        Specified by:
        getKey in interface Map.Entry<K,V>
        Returns:
        the key corresponding to this entry
      • getValue

        public V getValue()
        Returns the value corresponding to this entry.
        Specified by:
        getValue in interface Map.Entry<K,V>
        Returns:
        the value corresponding to this entry
      • setValue

        public V setValue(V value)
        Replaces the value corresponding to this entry with the specified value (optional operation). This implementation simply throws UnsupportedOperationException, as this class implements an immutable map entry.
        Specified by:
        setValue in interface Map.Entry<K,V>
        Parameters:
        value - new value to be stored in this entry
        Returns:
        (Does not return)
        Throws:
        UnsupportedOperationException - always
      • equals

        public boolean equals(Object o)
        Compares the specified object with this entry for equality. Returns true if the given object is also a map entry and the two entries represent the same mapping. More formally, two entries e1 and e2 represent the same mapping if
           (e1.getKey()==null ?
            e2.getKey()==null :
            e1.getKey().equals(e2.getKey()))
           &&
           (e1.getValue()==null ?
            e2.getValue()==null :
            e1.getValue().equals(e2.getValue()))
        This ensures that the equals method works properly across different implementations of the Map.Entry interface.
        Specified by:
        equals in interface Map.Entry<K,V>
        Overrides:
        equals in class Object
        Parameters:
        o - object to be compared for equality with this map entry
        Returns:
        true if the specified object is equal to this map entry
        See Also:
        hashCode()
      • hashCode

        public int hashCode()
        Returns the hash code value for this map entry. The hash code of a map entry e is defined to be:
           (e.getKey()==null   ? 0 : e.getKey().hashCode()) ^
           (e.getValue()==null ? 0 : e.getValue().hashCode())
        This ensures that e1.equals(e2) implies that e1.hashCode()==e2.hashCode() for any two Entries e1 and e2, as required by the general contract of Object.hashCode().
        Specified by:
        hashCode in interface Map.Entry<K,V>
        Overrides:
        hashCode in class Object
        Returns:
        the hash code value for this map entry
        See Also:
        equals(java.lang.Object)
      • toString

        public String toString()
        Returns a String representation of this map entry. This implementation returns the string representation of this entry's key followed by the equals character ("=") followed by the string representation of this entry's value.
        Overrides:
        toString in class Object
        Returns:
        a String representation of this map entry

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 04/03/2020 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-rf-java/util/AbstractMap.SimpleImmutableEntry.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.

Inhoudsopgave Haut