protected static class AbstractReferenceMap.ReferenceEntry<K,V> extends AbstractHashedMap.HashEntry<K,V>
| Modifier and Type | Field and Description |
|---|---|
protected AbstractReferenceMap<K,V> |
parent
The parent map
|
protected Reference<K> |
refKey |
protected Reference<V> |
refValue |
hashCode, next| Constructor and Description |
|---|
AbstractReferenceMap.ReferenceEntry(AbstractReferenceMap<K,V> parent,
AbstractReferenceMap.ReferenceEntry<K,V> next,
int hashCode,
K key,
V value)
Creates a new entry object for the ReferenceMap.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Compares this map entry to another.
|
K |
getKey()
Gets the key from the entry.
|
V |
getValue()
Gets the value from the entry.
|
int |
hashCode()
Gets the hashcode of the entry using temporary hard references.
|
protected AbstractReferenceMap.ReferenceEntry<K,V> |
next()
Gets the next entry in the bucket.
|
V |
setValue(V obj)
Sets the value of the entry.
|
protected <T> Reference<T> |
toReference(int type,
T referent,
int hash)
Constructs a reference of the given type to the given referent.
|
setKey, toStringprotected final AbstractReferenceMap<K,V> parent
public AbstractReferenceMap.ReferenceEntry(AbstractReferenceMap<K,V> parent, AbstractReferenceMap.ReferenceEntry<K,V> next, int hashCode, K key, V value)
parent - the parent mapnext - the next entry in the hash buckethashCode - the hash code of the keykey - the keyvalue - the valuepublic K getKey()
public V getValue()
public boolean equals(Object obj)
isEqualKey and
isEqualValue on the main map for comparison.public int hashCode()
hashEntry on the main map.protected <T> Reference<T> toReference(int type, T referent, int hash)
type - HARD, SOFT or WEAKreferent - the object to refer tohash - the hash code of the key of the mapping; this
number might be different from referent.hashCode() if the
referent represents a value and not a keyprotected AbstractReferenceMap.ReferenceEntry<K,V> next()
Copyright © 2014. All Rights Reserved.