Package net.sf.tweety.arg.adf.util
Class CacheSupplier<T>
- java.lang.Object
-
- net.sf.tweety.arg.adf.util.CacheSupplier<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
java.util.function.Supplier<T>
public class CacheSupplier<T> extends java.lang.Object implements java.util.function.Supplier<T>
Delegates the first get() call to the given supplier and stores its result in cache. Consecutive calls return the cached result, therefore computation is only done once. Does not maintain a reference to the delegate once its result is computed.- Author:
- Mathias Hofer
-
-
Constructor Summary
Constructors Constructor Description CacheSupplier(java.util.function.Supplier<T> delegate)
-