public abstract class LockingLazyVar<T> extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
LockingLazyVar.LazyVarInit<Q>
A simple init interface to make LockingLazyVar's easier to construct.
|
Modifier | Constructor and Description |
---|---|
protected |
LockingLazyVar() |
protected |
LockingLazyVar(ReadWriteLock lock) |
Modifier and Type | Method and Description |
---|---|
T |
clear()
Clears the variable, forcing the next call to
get() to re-calculate
the value. |
void |
clearNoLock() |
T |
get() |
protected abstract T |
init() |
boolean |
isLoaded() |
static <Q> LockingLazyVar<Q> |
make(LockingLazyVar.LazyVarInit<Q> init)
Creates a new LockingLazyVar based on the type of the LazyVarInit passed in.
|
static <Q> LockingLazyVar<Q> |
make(ReadWriteLock lock,
LockingLazyVar.LazyVarInit<Q> init) |
T |
set(T value) |
protected LockingLazyVar()
protected LockingLazyVar(ReadWriteLock lock)
public final T get()
protected abstract T init()
public final T clear()
get()
to re-calculate
the value.public final void clearNoLock()
public boolean isLoaded()
public static <Q> LockingLazyVar<Q> make(LockingLazyVar.LazyVarInit<Q> init)
public static <Q> LockingLazyVar<Q> make(ReadWriteLock lock, LockingLazyVar.LazyVarInit<Q> init)
Copyright © 2024. All rights reserved.