java.lang.Object | ||
↳ | org.apache.commons.collections.map.AbstractHashedMap.HashEntry | |
↳ | org.apache.commons.collections.map.AbstractReferenceMap.ReferenceEntry |
A MapEntry implementation for the map.
If getKey() or getValue() returns null, it means the mapping is stale and should be removed.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
parent | The parent map |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.collections.map.AbstractHashedMap.HashEntry
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new entry object for the ReferenceMap.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Compares this map entry to another.
| |||||||||||
Gets the key from the entry.
| |||||||||||
Gets the value from the entry.
| |||||||||||
Gets the hashcode of the entry using temporary hard references.
| |||||||||||
Sets the value of the entry.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Gets the next entry in the bucket.
| |||||||||||
Constructs a reference of the given type to the given referent.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.commons.collections.map.AbstractHashedMap.HashEntry
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.util.Map.Entry
| |||||||||||
From interface
org.apache.commons.collections.KeyValue
|
Creates a new entry object for the ReferenceMap.
parent | the parent map |
---|---|
next | the next entry in the hash bucket |
hashCode | the hash code of the key |
key | the key |
value | the value |
Compares this map entry to another.
This implementation uses isEqualKey
and
isEqualValue
on the main map for comparison.
obj | the other map entry to compare to |
---|
Gets the key from the entry. This method dereferences weak and soft keys and thus may return null.
Gets the value from the entry. This method dereferences weak and soft value and thus may return null.
Gets the hashcode of the entry using temporary hard references.
This implementation uses hashEntry
on the main map.
Sets the value of the entry.
obj | the object to store |
---|
Gets the next entry in the bucket.
Constructs a reference of the given type to the given referent. The reference is registered with the queue for later purging.
type | HARD, SOFT or WEAK |
---|---|
referent | the object to refer to |
hash | 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 key |