public abstract class AbstractVNumberArrayVNumberToVNumberArrayFormulaFunction extends Object implements FormulaFunction
VNumber
and a
VNumberArray
as arguments
and return a VNumberArray
.
This class takes care of:
VNumber
VNumberArray
Constructor and Description |
---|
AbstractVNumberArrayVNumberToVNumberArrayFormulaFunction(String name,
String description,
String arg1Name,
String arg2Name)
Creates a new function.
|
Modifier and Type | Method and Description |
---|---|
Object |
calculate(List<Object> args)
Calculate the result of the function given the arguments.
|
abstract ListNumber |
calculate(ListNumber arg1,
double arg2)
Calculates the result based on the two arguments.
|
List<String> |
getArgumentNames()
The ordered list of the argument names.
|
List<Class<?>> |
getArgumentTypes()
The ordered list of the arguments type.
|
String |
getDescription()
Return the description of the function.
|
String |
getName()
Return the name of the function.
|
Class<?> |
getReturnType()
The type of the function result.
|
boolean |
isPure()
Whether the function is a pure function, given the same
arguments always returns the same result.
|
boolean |
isVarArgs()
Whether the function takes a variable number of arguments.
|
public AbstractVNumberArrayVNumberToVNumberArrayFormulaFunction(String name, String description, String arg1Name, String arg2Name)
name
- function name; can't be nulldescription
- function description; can't be nullarg1Name
- first argument name; can't be nullarg2Name
- second argument name; can't be nullpublic final boolean isPure()
FormulaFunction
isPure
in interface FormulaFunction
public final boolean isVarArgs()
FormulaFunction
Variable arguments can only be at the end of the argument list, and have the same type.
isVarArgs
in interface FormulaFunction
public final String getName()
FormulaFunction
getName
in interface FormulaFunction
public final String getDescription()
FormulaFunction
getDescription
in interface FormulaFunction
public final List<Class<?>> getArgumentTypes()
FormulaFunction
getArgumentTypes
in interface FormulaFunction
public final List<String> getArgumentNames()
FormulaFunction
getArgumentNames
in interface FormulaFunction
public final Class<?> getReturnType()
FormulaFunction
getReturnType
in interface FormulaFunction
public final Object calculate(List<Object> args)
FormulaFunction
calculate
in interface FormulaFunction
args
- the argument listpublic abstract ListNumber calculate(ListNumber arg1, double arg2)
arg1
- the first argument; not nullarg2
- the second argumentCopyright © 2015. All rights reserved.