|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.collections.map.AbstractHashedMap.HashEntry org.apache.commons.collections.map.AbstractReferenceMap.ReferenceEntry
protected static class AbstractReferenceMap.ReferenceEntry
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 |
parent
The parent map |
Fields inherited from class org.apache.commons.collections.map.AbstractHashedMap.HashEntry |
---|
hashCode, key, next, value |
Constructor Summary | |
---|---|
AbstractReferenceMap.ReferenceEntry(AbstractReferenceMap parent,
AbstractHashedMap.HashEntry next,
int hashCode,
java.lang.Object key,
java.lang.Object value)
Creates a new entry object for the ReferenceMap. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
Compares this map entry to another. |
java.lang.Object |
getKey()
Gets the key from the entry. |
java.lang.Object |
getValue()
Gets the value from the entry. |
int |
hashCode()
Gets the hashcode of the entry using temporary hard references. |
protected AbstractReferenceMap.ReferenceEntry |
next()
Gets the next entry in the bucket. |
java.lang.Object |
setValue(java.lang.Object obj)
Sets the value of the entry. |
protected java.lang.Object |
toReference(int type,
java.lang.Object referent,
int hash)
Constructs a reference of the given type to the given referent. |
Methods inherited from class org.apache.commons.collections.map.AbstractHashedMap.HashEntry |
---|
toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final AbstractReferenceMap parent
Constructor Detail |
---|
public AbstractReferenceMap.ReferenceEntry(AbstractReferenceMap parent, AbstractHashedMap.HashEntry next, int hashCode, java.lang.Object key, java.lang.Object value)
parent
- the parent mapnext
- the next entry in the hash buckethashCode
- the hash code of the keykey
- the keyvalue
- the valueMethod Detail |
---|
public java.lang.Object getKey()
getKey
in interface java.util.Map.Entry
getKey
in interface KeyValue
getKey
in class AbstractHashedMap.HashEntry
public java.lang.Object getValue()
getValue
in interface java.util.Map.Entry
getValue
in interface KeyValue
getValue
in class AbstractHashedMap.HashEntry
public java.lang.Object setValue(java.lang.Object obj)
setValue
in interface java.util.Map.Entry
setValue
in class AbstractHashedMap.HashEntry
obj
- the object to store
public boolean equals(java.lang.Object obj)
This implementation uses isEqualKey
and
isEqualValue
on the main map for comparison.
equals
in interface java.util.Map.Entry
equals
in class AbstractHashedMap.HashEntry
obj
- the other map entry to compare to
public int hashCode()
This implementation uses hashEntry
on the main map.
hashCode
in interface java.util.Map.Entry
hashCode
in class AbstractHashedMap.HashEntry
protected java.lang.Object toReference(int type, java.lang.Object 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 next()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |