org.aspectbench.tm.runtime.internal
Class PersistentWeakRef
java.lang.Object
java.lang.ref.Reference<T>
java.lang.ref.WeakReference
org.aspectbench.tm.runtime.internal.MyWeakRef
org.aspectbench.tm.runtime.internal.PersistentWeakRef
public class PersistentWeakRef
- extends MyWeakRef
Method Summary |
boolean |
equals(java.lang.Object obj)
Only one PersistentWeakRef is ever constructed for a particular object. |
java.lang.Object |
get()
Return the referent while it's alive; after it is destroyed, return this. |
static MyWeakRef |
getWeakRef(java.lang.Object o)
|
Methods inherited from class java.lang.ref.Reference |
clear, enqueue, isEnqueued |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
PersistentWeakRef
protected PersistentWeakRef(java.lang.Object ref)
PersistentWeakRef
protected PersistentWeakRef(java.lang.Object ref,
java.lang.ref.ReferenceQueue q)
getWeakRef
public static MyWeakRef getWeakRef(java.lang.Object o)
equals
public boolean equals(java.lang.Object obj)
- Only one PersistentWeakRef is ever constructed for a particular object. Thus,
this PWR is equal to obj iff they are the same weak reference, or if obj is
the referent of this.
- Overrides:
equals
in class MyWeakRef
get
public java.lang.Object get()
- Return the referent while it's alive; after it is destroyed, return this.
TODO: Is it sound to always return 'this' instead?
- Overrides:
get
in class java.lang.ref.Reference