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