Package org.apache.sis.util.collection
Class WeakValueHashMap.Entry
java.lang.Object
java.lang.ref.Reference<V>
java.lang.ref.WeakReference<V>
org.apache.sis.util.collection.WeakEntry<V>
org.apache.sis.util.collection.WeakValueHashMap.Entry
- All Implemented Interfaces:
Map.Entry<K,
,V> Disposable
- Enclosing class:
WeakValueHashMap<K,
V>
An entry in the
WeakValueHashMap
. This is a weak reference
to a value together with a strong reference to a key.-
Field Summary
FieldsFields inherited from class org.apache.sis.util.collection.WeakEntry
hash, HASH_MASK, MIN_CAPACITY, next, REHASH_DELAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Invoked byReferenceQueueConsumer
for removing the reference from the enclosing collection.boolean
Compares the specified object with this entry for equality.getKey()
Returns the key corresponding to this entry.getValue()
Returns the value corresponding to this entry.int
hashCode()
Returns the hash code value for this map entry.Replaces the value corresponding in this entry with the specified value.Methods inherited from class org.apache.sis.util.collection.WeakEntry
count, lowerCapacityThreshold, rehash, removeFrom, upperCapacityThreshold
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence, refersTo
-
Field Details
-
key
The key.
-
-
Constructor Details
-
Entry
Constructs a new weak reference.
-
-
Method Details
-
getKey
Returns the key corresponding to this entry. -
getValue
Returns the value corresponding to this entry. -
setValue
Replaces the value corresponding in this entry with the specified value. This method can be used only for setting the value tonull
. -
dispose
public void dispose()Invoked byReferenceQueueConsumer
for removing the reference from the enclosing collection.- Specified by:
dispose
in interfaceDisposable
-
equals
Compares the specified object with this entry for equality. -
hashCode
public int hashCode()Returns the hash code value for this map entry. This hash code is not stable, since it will change after GC collect the value.
-