Kactoos

kactoos-jvm / nnl.rocks.kactoos.func / StickyBiFunc

StickyBiFunc

class StickyBiFunc<in X : Any, in Y : Any, out Z : Any> : 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.

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

Constructors

Name Summary
<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.

Functions

Name Summary
apply fun apply(first: X, second: Y): Z
Apply it.