| Modifier and Type | Field and Description |
|---|---|
private int |
hash
Stores the hash value.
|
private K |
key
Stores the key.
|
private HashMap.Entry<K,V> |
next
Stores the next entry.
|
private V |
value
Stores the value.
|
| Constructor and Description |
|---|
Entry(int hash,
K key,
V value,
HashMap.Entry<K,V> next)
Creates new entry.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object object)
Checks for equality with
object. |
K |
getKey()
Returns the key.
|
V |
getValue()
Returns the value.
|
int |
hashCode()
Returns the hash code for this instance.
|
(package private) void |
recordAccess(HashMap<K,V> map)
This method is invoked whenever the value in an entry is
overwritten by an invocation of put(k,v) for a key k that's already
in the HashMap.
|
(package private) void |
recordRemoval(HashMap<K,V> map)
This method is invoked whenever the entry is
removed from the table.
|
V |
setValue(V newValue)
Changes the value.
|
java.lang.String |
toString()
Returns a textual representation of this instance.
|
private final K key
private V value
private HashMap.Entry<K,V> next
private final int hash
Entry(int hash,
K key,
V value,
HashMap.Entry<K,V> next)
hash - the hash valuekey - the keyvalue - the valuenext - the next entrypublic final K getKey()
public final V getValue()
public final V setValue(V newValue)
newValue - the new valuepublic final boolean equals(java.lang.Object object)
object.equals in class java.lang.Objectobject - the object to check fortrue if object is equal to this,
false elsepublic final int hashCode()
hashCode in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.Objectvoid recordAccess(HashMap<K,V> map)
map - the hash map