|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectjava.lang.ref.Reference<T>
java.lang.ref.WeakReference
org.jomc.util.WeakIdentityHashMap.Entry
private static class WeakIdentityHashMap.Entry
A map entry (key-value pair) with weakly referenced key.
The WeakIdentityHashMap.entrySet method returns a collection-view of the map, whose elements are of
this class. The only way to obtain a reference to a map entry is from the iterator of this collection-view. These
Map.Entry objects are valid only for the duration of the iteration; more formally, the behavior of a map
entry is undefined if the backing map has been modified after the entry was returned by the iterator, except
through the setValue operation on the map entry.
WeakIdentityHashMap.entrySet()| Field Summary | |
|---|---|
private int |
hashCode
The hash code value of the key. |
private WeakIdentityHashMap.Entry |
next
The next entry in the bucket. |
private boolean |
removed
Flag indicating that this entry got removed from the map. |
private Object |
value
The value of the entry. |
| Constructor Summary | |
|---|---|
WeakIdentityHashMap.Entry(Object key,
Object value,
int hashCode,
ReferenceQueue queue)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
Compares a given object with this entry for equality. |
Object |
getKey()
Gets the key corresponding to this entry. |
Object |
getValue()
Gets the value corresponding to this entry. |
int |
hashCode()
Gets the hash code value for this map entry. |
private String |
internalString()
Creates a string representing the properties of the instance. |
Object |
setValue(Object value)
Replaces the value corresponding to this entry with the specified value. |
String |
toString()
Returns a string representation of the object. |
| Methods inherited from class java.lang.ref.Reference |
|---|
clear, enqueue, get, isEnqueued |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Object value
private WeakIdentityHashMap.Entry next
private boolean removed
private final int hashCode
| Constructor Detail |
|---|
WeakIdentityHashMap.Entry(Object key,
Object value,
int hashCode,
ReferenceQueue queue)
| Method Detail |
|---|
public Object getKey()
getKey in interface Map.EntryIllegalStateException - if the entry got removed from the backing map (either due to an iterator's
remove operation or due to the key having been garbage collected).public Object getValue()
getValue in interface Map.EntryIllegalStateException - if the entry got removed from the backing map (either due to an iterator's
remove operation or due to the key having been garbage collected).public Object setValue(Object value)
setValue in interface Map.Entryvalue - The new value to be stored in this entry.
NullPointerException - if value is null.
IllegalStateException - if the entry got removed from the backing map (either due to an iterator's
remove operation or due to the key having been garbage collected).public String toString()
toString in class Objectpublic boolean equals(Object o)
Returns true if the given object is also a map entry and the two entries represent the same
mapping. More formally, two entries e1 and e2 represent the same mapping if
( e1.getKey() == e2.getKey() ) && ( e1.getValue().equals( e2.getValue() ) )
equals in interface Map.Entryequals in class Objecto - The object to be compared for equality with this map entry.
true if o is equal to this map entry; false if o is not equal to this
map entry.public int hashCode()
The hash code of a map entry e is defined to be:
( e.getKey() == null ? 0 : e.getKey().hashCode() ) ^ ( e.getValue() == null ? 0 : e.getValue().hashCode() )
hashCode in interface Map.EntryhashCode in class Objectprivate String internalString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||