Kactoos

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

StickyFunc

class StickyFunc<in X : Any, out Y : Any> : Func<X, Y>

Func that caches previously calculated values and doesn’t recalculate again.

This Func decorator technically is an in-memory cache.

There is no thread-safety guarantee. It is highly recommended to decorate it with SyncFunc

Parameters

X - Type of input

Y - Type of output

See Also

nnl.rocks.kactoos.scalar.StickyScalar

Since 0.1

Constructors

Name Summary
<init> StickyFunc(func: BiFunc<X, Boolean, Y>)
StickyFunc(fnc: Func<X, Y>, max: Int)
StickyFunc(fnc: Func<X, Y>)StickyFunc(func: KBiFunc<X, Boolean, Y>)
Func that caches previously calculated values and doesn’t recalculate again.

Functions

Name Summary
apply fun apply(input: X): Y
Apply it.