public class Functions
extends java.lang.Object
Constructor and Description |
---|
Functions() |
Modifier and Type | Method and Description |
---|---|
static <X,Y,Z> Function<X,Z> |
compose(Function<Y,Z> g,
Function<X,Y> f) |
static <X,Y> Function<X,Y> |
constant(Y y) |
static <X> Function<X,X> |
identity() |
static double |
integrate(Function<java.lang.Integer,java.lang.Double> x,
Function<java.lang.Integer,java.lang.Double> y,
int from,
int to)
Integrates "area under curve" (assuming it exists),
that is, for a parametric curve specified by functions x and y,
defined on integer domain [from, to], calculate the area
between x[from], x[to], horizontal axis, and the curve.
|
static <X,Y> java.lang.Iterable<Y> |
map(java.lang.Iterable<X> xs,
Function<X,Y> f) |
static <T> Function<java.lang.Long,T> |
onList(java.util.List<T> list) |
static Unfoldable<java.lang.String,java.lang.String> |
splitBy(java.lang.String separator) |
public static <X> Function<X,X> identity()
public static <T> Function<java.lang.Long,T> onList(java.util.List<T> list)
public static <X,Y> java.lang.Iterable<Y> map(java.lang.Iterable<X> xs, Function<X,Y> f)
public static <X,Y> Function<X,Y> constant(Y y)
public static Unfoldable<java.lang.String,java.lang.String> splitBy(java.lang.String separator)
public static double integrate(Function<java.lang.Integer,java.lang.Double> x, Function<java.lang.Integer,java.lang.Double> y, int from, int to)
x
- x-component of the curvey
- y-component of the curvefrom
- min value of the curve rangeto
- max value of the curve range