Package manifold.util.concurrent
Class LockingLazyVar<T>
- java.lang.Object
-
- manifold.util.concurrent.LockingLazyVar<T>
-
public abstract class LockingLazyVar<T> extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLockingLazyVar.LazyVarInit<Q>A simple init interface to make LockingLazyVar's easier to construct.
-
Constructor Summary
Constructors Modifier Constructor Description protectedLockingLazyVar()protectedLockingLazyVar(ReadWriteLock lock)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tclear()Clears the variable, forcing the next call toget()to re-calculate the value.voidclearNoLock()Tget()protected abstract Tinit()booleanisLoaded()static <Q> LockingLazyVar<Q>make(ReadWriteLock lock, LockingLazyVar.LazyVarInit<Q> init)static <Q> LockingLazyVar<Q>make(LockingLazyVar.LazyVarInit<Q> init)Creates a new LockingLazyVar based on the type of the LazyVarInit passed in.Tset(T value)
-
-
-
Constructor Detail
-
LockingLazyVar
protected LockingLazyVar()
-
LockingLazyVar
protected LockingLazyVar(ReadWriteLock lock)
-
-
Method Detail
-
get
public final T get()
- Returns:
- the value of this lazy var, created if necessary
-
init
protected abstract T init()
-
clear
public final T clear()
Clears the variable, forcing the next call toget()to re-calculate the value.
-
clearNoLock
public final void clearNoLock()
-
isLoaded
public boolean isLoaded()
-
make
public static <Q> LockingLazyVar<Q> make(LockingLazyVar.LazyVarInit<Q> init)
Creates a new LockingLazyVar based on the type of the LazyVarInit passed in.
-
make
public static <Q> LockingLazyVar<Q> make(ReadWriteLock lock, LockingLazyVar.LazyVarInit<Q> init)
-
-