Package org.jboss.util.collection
Class WeakValueRef<K,V>
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.WeakReference<V>
-
- org.jboss.util.collection.WeakValueRef<K,V>
-
-
Constructor Summary
Constructors Modifier Constructor Description private
WeakValueRef(K key, V val, java.lang.ref.ReferenceQueue<V> q)
Create a new WeakValueRef.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static <K,V>
WeakValueRef<K,V>create(K key, V val, java.lang.ref.ReferenceQueue<V> q)
Safely create a new WeakValueRefK
getKey()
V
getValue()
V
setValue(V value)
java.lang.String
toString()
-
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence
-
-
-
-
Field Detail
-
key
public K key
The key
-
-
Method Detail
-
create
static <K,V> WeakValueRef<K,V> create(K key, V val, java.lang.ref.ReferenceQueue<V> q)
Safely create a new WeakValueRef- Type Parameters:
K
- the key typeV
- the value type- Parameters:
key
- the keyval
- the valueq
- the reference queue- Returns:
- the reference or null if the value is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-