Interface Map.Entry<K,V>
- All Known Implementing Classes:
AbstractMap.SimpleEntry, AbstractMap.SimpleImmutableEntry
public static interface Map.Entry<K,V>
Map.Entry is a key/value mapping contained in a Map.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K extends Comparable<? super K>, V>
Comparator<Map.Entry<K, V>> Orders entries by the natural order of their keys.static <K,V> Comparator <Map.Entry<K, V>> comparingByKey(Comparator<? super K> comparator) Orders entries by their keys, ascomparatororders them.static <K, V extends Comparable<? super V>>
Comparator<Map.Entry<K, V>> Orders entries by the natural order of their values.static <K,V> Comparator <Map.Entry<K, V>> comparingByValue(Comparator<? super V> comparator) Orders entries by their values, ascomparatororders them.booleanCompares the specified object to thisMap.Entryand returns if they are equal.getKey()Returns the key.getValue()Returns the value.inthashCode()Returns an integer hash code for the receiver.Sets the value of this entry to the specified value, replacing any existing value.
-
Method Details
-
equals
Compares the specified object to this
Map.Entryand returns if they are equal. To be equal, the object must be an instance ofMap.Entryand have the same key and value.Parameters
object: theObjectto compare with thisObject.
Returns
-
getKey
K getKey()Returns the key.
Returns
the key
-
getValue
V getValue()Returns the value.
Returns
the value
-
hashCode
-
setValue
-
comparingByKey
Orders entries by the natural order of their keys. -
comparingByValue
Orders entries by the natural order of their values. -
comparingByKey
Orders entries by their keys, ascomparatororders them. -
comparingByValue
Orders entries by their values, ascomparatororders them.
-