Package art.cutils.function
Class LazyFunction<T,R>
- java.lang.Object
-
- art.cutils.function.LazyFunction<T,R>
-
- Type Parameters:
T
- the result typeR
- the return type
- All Implemented Interfaces:
Serializable
,Function<T,R>
public final class LazyFunction<T,R> extends Object implements Function<T,R>, Serializable
TheLazyFunction
is intended to be memorized and idempotent for every parameter. This can be very useful for operations with high latency whose result are used multitudinous. .The result of every function operation are store and retrieves if the same parameter is passed instead of computing again. Every operation is performed once with unique parameters and the result and served whenever needed.- Since:
- 1.0
- Author:
- , Bobai Kato
- See Also:
Function
, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description R
apply(T t)
Applies this function to the given argument.boolean
equals(Object o)
int
hashCode()
static <T,R>
@NotNull Function<T,R>of(Function<? super T,? extends R> function)
Take the function operation ofFunction
type.
-