|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.collections15.map.AbstractHashedMap.HashEntry<K,V>
org.apache.commons.collections15.map.AbstractReferenceMap.ReferenceEntry<K,V>
protected static class AbstractReferenceMap.ReferenceEntry<K,V>
A MapEntry implementation for the map.
If getKey() or getValue() returns null, it means the mapping is stale and should be removed.
| Field Summary | |
|---|---|
protected AbstractReferenceMap<K,V> |
parent
The parent map |
protected Reference<K> |
refKey
|
protected Reference<V> |
refValue
|
| Fields inherited from class org.apache.commons.collections15.map.AbstractHashedMap.HashEntry |
|---|
hashCode, next |
| Constructor Summary | |
|---|---|
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. |
|
| Method Summary | ||
|---|---|---|
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
|
toReference(int type,
T referent,
int hash)
Constructs a reference of the given type to the given referent. |
|
| Methods inherited from class org.apache.commons.collections15.map.AbstractHashedMap.HashEntry |
|---|
setKey, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final AbstractReferenceMap<K,V> parent
protected Reference<K> refKey
protected Reference<V> refValue
| Constructor Detail |
|---|
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 value| Method Detail |
|---|
public K getKey()
getKey in interface Map.Entry<K,V>getKey in interface KeyValue<K,V>getKey in class AbstractHashedMap.HashEntry<K,V>public V getValue()
getValue in interface Map.Entry<K,V>getValue in interface KeyValue<K,V>getValue in class AbstractHashedMap.HashEntry<K,V>public V setValue(V obj)
setValue in interface Map.Entry<K,V>setValue in class AbstractHashedMap.HashEntry<K,V>obj - the object to store
public boolean equals(Object obj)
isEqualKey and
isEqualValue on the main map for comparison.
equals in interface Map.Entry<K,V>equals in class AbstractHashedMap.HashEntry<K,V>obj - the other map entry to compare to
public int hashCode()
hashEntry on the main map.
hashCode in interface Map.Entry<K,V>hashCode in class AbstractHashedMap.HashEntry<K,V>
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()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||