public abstract static class CompactMap.MapEntry<K,V> extends Object implements Map.Entry<K,V>
Constructor and Description |
---|
MapEntry() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Implementation that adheres to
Map.Entry.equals(Object) contract. |
abstract K |
getKey() |
abstract V |
getValue() |
int |
hashCode()
Implementation that adheres to
Map.Entry.hashCode() contract. |
int |
keyHashCode()
Get stored hash code of the key contained in this entry.
|
CompactMap.MapEntry<K,V> |
nextMapEntry()
Get next map entry linked to this one.
|
abstract V |
setValue(V value) |
protected abstract boolean |
valueEquals(Object value2)
Used by
CompactMap.MapEntry.equals(Object) to check whether the value
held by this map entry equals to the the given value. |
protected abstract int |
valueHashCode()
Used by
CompactMap.MapEntry.hashCode() to return the real hashCode for the value
held by this map entry. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparingByKey, comparingByKey, comparingByValue, comparingByValue, copyOf
protected abstract int valueHashCode()
CompactMap.MapEntry.hashCode()
to return the real hashCode for the value
held by this map entry.
getValue().hashCode
cannot be used in general because
getValue()
may return this
e.g. in case
the value is represented by primitive data type. The method should
use that real value for the hash code computation.protected abstract boolean valueEquals(Object value2)
CompactMap.MapEntry.equals(Object)
to check whether the value
held by this map entry equals to the the given value.
getValue().equals()
cannot be used in general because
getValue()
may return this
e.g. in case
the value is represented by primitive data type. The method should
use that real value for the operation of this method.value2
- value to be compared with value stored in this entry.
The argument may be null.public final CompactMap.MapEntry<K,V> nextMapEntry()
CompactMap.getFirstEntry(int)
.public final int keyHashCode()
CompactMap.getFirstEntry(int)
to quickly exclude entries which hash code differs from the requested one.public final int hashCode()
Map.Entry.hashCode()
contract.