Package org.apfloat.calc
Class FunctionCalculatorImpl.FixedFunction
- java.lang.Object
-
- org.apfloat.calc.FunctionCalculatorImpl.FixedFunction
-
- All Implemented Interfaces:
java.io.Serializable,FunctionCalculatorImpl.Function
- Enclosing class:
- FunctionCalculatorImpl
protected class FunctionCalculatorImpl.FixedFunction extends java.lang.Object implements FunctionCalculatorImpl.Function
Function taking a fixed number of arguments.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private FunctionCalculatorImpl.FixedFunctionHandlerhandlerprivate intmaxArgumentsprivate intminArgumentsprivate java.lang.Stringnameprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protectedFixedFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Numbercall(java.util.List<java.lang.Number> arguments)Call the function.protected voidvalidate(java.util.List<java.lang.Number> arguments)Validate the number of arguments.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
name
private java.lang.String name
-
minArguments
private int minArguments
-
maxArguments
private int maxArguments
-
handler
private FunctionCalculatorImpl.FixedFunctionHandler handler
-
-
Method Detail
-
validate
protected void validate(java.util.List<java.lang.Number> arguments) throws ParseExceptionValidate the number of arguments.- Parameters:
arguments- The function's arguments.- Throws:
ParseException- In case of incorrect number of arguments.
-
call
public final java.lang.Number call(java.util.List<java.lang.Number> arguments) throws ParseExceptionDescription copied from interface:FunctionCalculatorImpl.FunctionCall the function.- Specified by:
callin interfaceFunctionCalculatorImpl.Function- Parameters:
arguments- The function's arguments.- Returns:
- The function's value.
- Throws:
ParseException- In case the arguments are invalid.
-
-