public abstract class FunctionCalculatorImpl extends AbstractCalculatorImpl
Modifier and Type | Class and Description |
---|---|
protected class |
FunctionCalculatorImpl.FixedFunction
Function taking a fixed number of arguments.
|
protected static interface |
FunctionCalculatorImpl.Function
Arbitrary function.
|
protected static interface |
FunctionCalculatorImpl.Functions
Function implementations.
|
Modifier | Constructor and Description |
---|---|
protected |
FunctionCalculatorImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Number |
function(String name,
List<Number> arguments)
Arbitrary function.
|
protected abstract FunctionCalculatorImpl.Functions |
getFunctions(Number x)
Get the function implementations.
|
protected abstract Number |
promote(Number x)
Promote a number to a more specific class.
|
protected void |
setFunction(String name,
FunctionCalculatorImpl.Function function)
Define a function.
|
add, divide, getFormat, getVariable, mod, multiply, negate, pow, setFormat, setVariable, subtract
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
format, parseDecimal, parseInteger
public Number function(String name, List<Number> arguments) throws ParseException
CalculatorImpl
name
- Name of the function.arguments
- Function arguments.ParseException
- In case of invalid arguments.protected void setFunction(String name, FunctionCalculatorImpl.Function function)
name
- The function name.function
- The function.protected abstract FunctionCalculatorImpl.Functions getFunctions(Number x)
x
- The number to use as the function argument.Copyright © 2017. All rights reserved.