org.decisiondeck.jmcda.utils
Class FunctionUtils
java.lang.Object
org.decisiondeck.jmcda.utils.FunctionUtils
public class FunctionUtils
- extends Object
|
Method Summary |
static
|
compose(Function<B,? extends C> g,
FunctionWithInputCheck<A,? extends B> f)
|
static
|
compose(FunctionWithInputCheck<B,? extends C> g,
Function<A,? extends B> f)
|
static
|
compose(FunctionWithInputCheck<B,? extends C> g,
FunctionWithInputCheck<A,? extends B> f)
|
static
|
constant(V value)
|
static
|
functionWithInputCheck(Function<F,V> f)
Transforms a function into a function with input check. |
static
|
identity()
|
FunctionUtils
public FunctionUtils()
compose
public static <A,B,C> FunctionWithInputCheck<A,C> compose(Function<B,? extends C> g,
FunctionWithInputCheck<A,? extends B> f)
compose
public static <A,B,C> FunctionWithInputCheck<A,C> compose(FunctionWithInputCheck<B,? extends C> g,
Function<A,? extends B> f)
compose
public static <A,B,C> FunctionWithInputCheck<A,C> compose(FunctionWithInputCheck<B,? extends C> g,
FunctionWithInputCheck<A,? extends B> f)
functionWithInputCheck
public static <F,F2 extends F,V2,V extends V2> FunctionWithInputCheck<F2,V2> functionWithInputCheck(Function<F,V> f)
- Transforms a function into a function with input check. This is mainly intended as a technical method to provide
type compatibility where a function with input check is expected instead of a function. The returned function
does not throw
InvalidInputExceptions.
- Type Parameters:
F - the domain of the given function: the type of value it expects.V - the codomain of the given function: the type of value it returns.F2 - the domain of the returned function: the type of value it expects.V2 - the codomain of the returned function: the type of value it returns.- Parameters:
f - not null.
- Returns:
- not
null.
constant
public static <F,V> FunctionWithInputCheck<F,V> constant(V value)
identity
public static <E> FunctionWithInputCheck<E,E> identity()
- Type Parameters:
E - the input and output type of the function.
- Returns:
- the identity function.
Copyright © 2011. All Rights Reserved.