Kactoos

kactoos-jvm / nnl.rocks.kactoos.func / StickyBiFunc / <init>

<init>

StickyBiFunc(func: KBiFunc<X, Y, Z>) StickyBiFunc(func: BiFunc<X, Y, Z>) StickyBiFunc(func: BiFunc<X, Y, Z>, size: Int)StickyBiFunc(func: KBiFunc<X, Y, Z>, size: Int)

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.

Parameters

X - Type of input

Y - Type of input

Z - Type of output

func - Original function

size - Cache size

See Also

nnl.rocks.kactoos.scalar.StickyScalar

Since 0.4