Class CacheRef
java.lang.Object
|
+--CacheRef
- Direct Known Subclasses:
- ImageJob
- public class CacheRef
- extends java.lang.Object
|
Field Summary |
private java.lang.Object |
lock
|
(package private) java.lang.ref.SoftReference |
ref
|
|
Constructor Summary |
(package private) |
CacheRef()
|
|
CacheRef(java.lang.Object target)
|
|
Method Summary |
java.lang.Object |
get()
|
boolean |
lock(boolean hold)
Lock or unlock the cached object.
lock(true) makes the CacheRef act like a hard reference. |
void |
set(java.lang.Object target)
|
static void |
uses(java.lang.Object user,
CacheRef target)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ref
transient java.lang.ref.SoftReference ref
lock
private transient java.lang.Object lock
CacheRef
CacheRef()
CacheRef
public CacheRef(java.lang.Object target)
set
public void set(java.lang.Object target)
get
public java.lang.Object get()
lock
public boolean lock(boolean hold)
- Lock or unlock the cached object.
lock(true) makes the CacheRef act like a hard reference.
The object cannot be reclaimed.
returns true iff the reference is not null.
lock(false) unlocks the reference so it may cleared, and
always returns true.
uses
public static void uses(java.lang.Object user,
CacheRef target)