Package org.cactoos.func
Class StickyFunc<X,Y>
- java.lang.Object
-
- org.cactoos.func.StickyFunc<X,Y>
-
- Type Parameters:
X
- Type of inputY
- Type of output
- All Implemented Interfaces:
Func<X,Y>
public final class StickyFunc<X,Y> extends Object implements Func<X,Y>
Func that caches previously calculated values and doesn't recalculate again.This
Func
decorator technically is an in-memory cache.Pay attention that this class is not thread-safe. It is highly recommended to always decorate it with
SyncFunc
.There is no thread-safety guarantee.
- Since:
- 0.1
- See Also:
Sticky
-
-
Constructor Summary
Constructors Constructor Description StickyFunc(Func<X,Y> fnc)
Ctor.StickyFunc(Func<X,Y> fnc, int max)
Ctor.
-