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