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.FixedFunctionHandler
handler
private int
maxArguments
private int
minArguments
private java.lang.String
name
private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description protected
FixedFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Number
call(java.util.List<java.lang.Number> arguments)
Call the function.protected void
validate(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 ParseException
Validate 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 ParseException
Description copied from interface:FunctionCalculatorImpl.Function
Call the function.- Specified by:
call
in interfaceFunctionCalculatorImpl.Function
- Parameters:
arguments
- The function's arguments.- Returns:
- The function's value.
- Throws:
ParseException
- In case the arguments are invalid.
-
-