Package org.arakhne.afc.references
Class ComparableWeakReference<T>
- java.lang.Object
-
- java.lang.ref.Reference<T>
-
- java.lang.ref.WeakReference<T>
-
- org.arakhne.afc.references.ComparableWeakReference<T>
-
- Type Parameters:
T
- is the type of the referenced object.
- All Implemented Interfaces:
Comparable<Object>
public class ComparableWeakReference<T> extends WeakReference<T> implements Comparable<Object>
This class is a WeakReference that allows to be compared on its pointed value.- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- references
-
-
Constructor Summary
Constructors Constructor Description ComparableWeakReference(T referent)
Constructor.ComparableWeakReference(T referent, ReferenceQueue<? super T> queue)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object obj)
boolean
equals(Object obj)
int
hashCode()
String
toString()
-
Methods inherited from class java.lang.ref.Reference
clear, clone, enqueue, get, isEnqueued, reachabilityFence
-
-
-
-
Constructor Detail
-
ComparableWeakReference
public ComparableWeakReference(T referent)
Constructor.- Parameters:
referent
- is the referenced object.
-
ComparableWeakReference
public ComparableWeakReference(T referent, ReferenceQueue<? super T> queue)
Constructor.- Parameters:
referent
- is the referenced object.queue
- is the object that will be notified of the memory released for the referenced object.
-
-
Method Detail
-
compareTo
@Pure public int compareTo(Object obj)
- Specified by:
compareTo
in interfaceComparable<T>
-
-