Package io.deephaven.util.datastructures
Class SoftCachingFunction<INPUT_TYPE,OUTPUT_TYPE>
java.lang.Object
io.deephaven.util.datastructures.SoftCachingFunction<INPUT_TYPE,OUTPUT_TYPE>
- Type Parameters:
OUTPUT_TYPE
- the type of results supplied by this function
- All Implemented Interfaces:
Function<INPUT_TYPE,
OUTPUT_TYPE>
public final class SoftCachingFunction<INPUT_TYPE,OUTPUT_TYPE>
extends Object
implements Function<INPUT_TYPE,OUTPUT_TYPE>
Function
wrapper that caches the result in a SoftReference
. Only suitable to wrap functions that are
safely repeatable and don't return null
.-
Constructor Summary
ConstructorDescriptionSoftCachingFunction
(@NotNull Function<INPUT_TYPE, OUTPUT_TYPE> internalFunction) Construct aFunction
wrapper. -
Method Summary
-
Constructor Details
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<INPUT_TYPE,
OUTPUT_TYPE>
-