|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 value| Method Detail |
|---|
public java.lang.Object getKey()
getKey in interface java.util.Map.EntrygetKey in interface KeyValuegetKey in class AbstractHashedMap.HashEntrypublic java.lang.Object getValue()
getValue in interface java.util.Map.EntrygetValue in interface KeyValuegetValue in class AbstractHashedMap.HashEntrypublic java.lang.Object setValue(java.lang.Object obj)
setValue in interface java.util.Map.EntrysetValue in class AbstractHashedMap.HashEntryobj - 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.Entryequals in class AbstractHashedMap.HashEntryobj - the other map entry to compare to
public int hashCode()
This implementation uses hashEntry on the main map.
hashCode in interface java.util.Map.EntryhashCode 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 | |||||||||