Package redempt.crunch.functional
Class Function
java.lang.Object
redempt.crunch.functional.Function
- All Implemented Interfaces:
Token
Represents a function which can be called in expressions whose environments have it
-
Constructor Summary
ConstructorDescriptionFunction
(String name, int argCount, ToDoubleFunction<double[]> function) Create a Function -
Method Summary
-
Constructor Details
-
Function
Create a Function- Parameters:
name
- The function nameargCount
- The number of arguments this Function will takefunction
- A lambda to take the arguments as a double array and return a value
-
-
Method Details
-
getName
- Returns:
- The name of this function
-
getArgCount
public int getArgCount()- Returns:
- The number of arguments this function takes
-
call
public double call(double[] values) Calls this function with a set of values - Warning, no validation is done on array size- Parameters:
values
- The input values- Returns:
- The output value
-
getType
-