T
- result-typepublic abstract class CachedSupplierBase<T> extends Object
Constructor and Description |
---|
CachedSupplierBase() |
Modifier and Type | Method and Description |
---|---|
protected <E extends Exception> |
call(CheckedSupplier<T,E> supplier)
Gets the value supplied by
supplier via the cache if it exists, or otherwise via the
supplier. |
boolean |
isEvaluated()
Has the function already been evaluated?
|
void |
reset()
Ensures the object is unevaluated, deleting any cached result if it exists.
|
public boolean isEvaluated()
i.e. does a value already exist in the cache.
protected <E extends Exception> T call(CheckedSupplier<T,E> supplier) throws E extends Exception
supplier
via the cache if it exists, or otherwise via the
supplier.
The value is then cached, and the object is considered as evaluated.
E
- an exception that can be thrown by supplier
.supplier
- the operation used to create the value.E
- if thrown by supplier
.E extends Exception
public void reset()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.