Package org.apache.sis.util.collection
Class WeakValueHashMap.Entry
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference<E>
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 TypeMethodDescriptionvoiddispose()Invoked byReferenceQueueConsumerfor removing the reference from the enclosing collection.booleanCompares the specified object with this entry for equality.getKey()Returns the key corresponding to this entry.getValue()Returns the value corresponding to this entry.inthashCode()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, upperCapacityThresholdMethods inherited from class java.lang.ref.Reference
clear, enqueue, get, isEnqueued
-
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 byReferenceQueueConsumerfor removing the reference from the enclosing collection.- Specified by:
disposein 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.
-