public abstract class LazyValue<K,V>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
HARD |
static int |
SOFT |
static int |
WEAK |
Constructor and Description |
---|
LazyValue(int type, K key) |
LazyValue(int type, K key, V value) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the soft or weak referenes
|
protected abstract V |
evaluate() |
K |
getKey()
Returns the key;
|
V |
getValue()
returns the value, compute it if necessary
|
V |
peekValue()
Returns the value if it is currenrly available.
|
public static final int HARD
public static final int SOFT
public static final int WEAK
public LazyValue(int type, K key)
public final K getKey()
public final void clear()
public final V peekValue()
public final V getValue()
protected abstract V evaluate()