Package org.moddingx.libx.util.lazy
Class CachedValue<T>
java.lang.Object
org.moddingx.libx.util.lazy.CachedValue<T>
A lazy value that is resolved when it is first used. However, this one can be invalidated,
which causes it to recompute the value next time.
-
Constructor Details
-
CachedValue
Creates a new cached value.
-
-
Method Details
-
get
Gets the value. If currently invalid, computes the value. -
copy
Returns a new cached value. If this cached value is currently valid, the new cached value will include the currently valid value. After that both values can be invalidated independent of each other. -
invalidate
public void invalidate()Invalidates the cached value.
-