Package org.apfloat.calc
Class ApfloatCalculatorImpl
- java.lang.Object
-
- org.apfloat.calc.AbstractCalculatorImpl
-
- org.apfloat.calc.FunctionCalculatorImpl
-
- org.apfloat.calc.ApfloatCalculatorImpl
-
- All Implemented Interfaces:
Serializable
,CalculatorImpl
public class ApfloatCalculatorImpl extends FunctionCalculatorImpl
Arbitrary precision calculator implementation.- Version:
- 1.9.1
- Author:
- Mikko Tommila
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apfloat.calc.FunctionCalculatorImpl
FunctionCalculatorImpl.FixedFunction, FunctionCalculatorImpl.FixedFunctionHandler, FunctionCalculatorImpl.Function, FunctionCalculatorImpl.Functions
-
-
Constructor Summary
Constructors Constructor Description ApfloatCalculatorImpl()
Default constructor.
-
Method Summary
Modifier and Type Method Description String
format(Number x)
Convert a number to a String.protected FunctionCalculatorImpl.Functions
getFunctions(Number x)
Get the function implementations.Number
parseDecimal(String value)
Parse a string to a floating-point number.Number
parseInteger(String value)
Parse a string to an integer number.protected Number
promote(Number x)
Promote a number to a more specific class.-
Methods inherited from class org.apfloat.calc.FunctionCalculatorImpl
fixedFunction, fixedFunction, function, setFunction
-
Methods inherited from class org.apfloat.calc.AbstractCalculatorImpl
add, divide, getFormat, getInputPrecision, getVariable, mod, multiply, negate, pow, setFormat, setInputPrecision, setVariable, subtract
-
-
-
-
Method Detail
-
parseInteger
public Number parseInteger(String value)
Description copied from interface:CalculatorImpl
Parse a string to an integer number.- Parameters:
value
- The string to parse.- Returns:
- The number.
-
parseDecimal
public Number parseDecimal(String value)
Description copied from interface:CalculatorImpl
Parse a string to a floating-point number.- Parameters:
value
- The string to parse.- Returns:
- The number.
-
format
public String format(Number x)
Description copied from interface:CalculatorImpl
Convert a number to a String. The current formatting option is used.- Parameters:
x
- The number.- Returns:
- The String.
-
getFunctions
protected FunctionCalculatorImpl.Functions getFunctions(Number x)
Description copied from class:FunctionCalculatorImpl
Get the function implementations.- Specified by:
getFunctions
in classFunctionCalculatorImpl
- Parameters:
x
- The number to use as the function argument.- Returns:
- The function implementations.
-
promote
protected Number promote(Number x)
Description copied from class:FunctionCalculatorImpl
Promote a number to a more specific class.- Specified by:
promote
in classFunctionCalculatorImpl
- Parameters:
x
- The argument.- Returns:
- The argument, possibly converted to a more specific subclass.
-
-