public class DoubleEvaluator extends AbstractEvaluator<java.lang.Double>
Modifier and Type | Field and Description |
---|---|
static Function |
ABS
Returns the absolute value of a number
|
static Function |
ACOSINE
Returns the trigonometric arc-cosine of an angle.
|
static Function |
ASINE
Returns the trigonometric arc-sine of an angle.
|
static Function |
ATAN
Returns the trigonometric arc-tangent of an angle.
|
static Function |
AVERAGE
Returns the average of n numbers (n>=1)
|
static Function |
CEIL
Returns the smallest integer >= argument
|
static Function |
COSINE
Returns the trigonometric cosine of an angle.
|
static Function |
COSINEH
Returns the hyperbolic cosine of a number.
|
static Operator |
DIVIDE
The division operator.
|
static Constant |
E
A constant that represents e (2.718281...)
|
static Operator |
EXPONENT
The exponentiation operator.
|
static Function |
FLOOR
Returns the largest integer <= argument
|
static Function |
LN
Returns the natural logarithm of a number
|
static Function |
LOG
Returns the decimal logarithm of a number
|
static Function |
MAX
Returns the maximum of n numbers (n>=1)
|
static Function |
MIN
Returns the minimum of n numbers (n>=1)
|
static Operator |
MINUS
The substraction operator.
|
static Operator |
MODULO
The modulo operator.
|
static Operator |
MULTIPLY
The multiplication operator.
|
static Operator |
NEGATE
The negate unary operator.
|
static Constant |
PI
A constant that represents pi (3.14159...)
|
static Operator |
PLUS
The addition operator.
|
static Function |
RANDOM
Returns a pseudo random number
|
static Function |
ROUND
Returns the closest integer of a number
|
static Function |
SINE
Returns the trigonometric sine of an angle.
|
static Function |
SINEH
Returns the hyperbolic sine of a number.
|
static Function |
SUM
Returns the sum of n numbers (n>=1)
|
static Function |
TANGENT
Returns the trigonometric tangent of an angle.
|
static Function |
TANGENTH
Returns the hyperbolic tangent of a number.
|
Constructor and Description |
---|
DoubleEvaluator()
Constructor.
|
DoubleEvaluator(Parameters parameters)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Double |
evaluate(Constant constant,
java.lang.Object evaluationContext)
Evaluates a constant.
|
protected java.lang.Double |
evaluate(Function function,
java.util.Iterator<java.lang.Double> arguments,
java.lang.Object evaluationContext)
Evaluates a function.
|
protected java.lang.Double |
evaluate(Operator operator,
java.util.Iterator<java.lang.Double> operands,
java.lang.Object evaluationContext)
Evaluates an operation.
|
static Parameters |
getDefaultParameters()
Gets a copy of DoubleEvaluator default parameters.
|
protected java.lang.Double |
toValue(java.lang.String literal,
java.lang.Object evaluationContext)
Evaluates a literal (Converts it to a value).
|
evaluate, evaluate, getConstants, getFunctions, getOperators, guessOperator, validateHomonyms
public static final Constant PI
public static final Constant E
public static final Function CEIL
public static final Function FLOOR
public static final Function ROUND
public static final Function ABS
public static final Function SINE
public static final Function COSINE
public static final Function TANGENT
public static final Function ACOSINE
public static final Function ASINE
public static final Function ATAN
public static final Function SINEH
public static final Function COSINEH
public static final Function TANGENTH
public static final Function MIN
public static final Function MAX
public static final Function SUM
public static final Function AVERAGE
public static final Function LN
public static final Function LOG
public static final Function RANDOM
public static final Operator NEGATE
public static final Operator MINUS
public static final Operator PLUS
public static final Operator MULTIPLY
public static final Operator DIVIDE
public static final Operator EXPONENT
public static final Operator MODULO
public DoubleEvaluator()
public DoubleEvaluator(Parameters parameters)
parameters
- The parameters of the evaluator.public static Parameters getDefaultParameters()
protected java.lang.Double toValue(java.lang.String literal, java.lang.Object evaluationContext)
AbstractEvaluator
toValue
in class AbstractEvaluator<java.lang.Double>
literal
- The literal to evaluate.evaluationContext
- The context of the evaluationprotected java.lang.Double evaluate(Constant constant, java.lang.Object evaluationContext)
AbstractEvaluator
evaluate
in class AbstractEvaluator<java.lang.Double>
constant
- The constantevaluationContext
- The context of the evaluationprotected java.lang.Double evaluate(Operator operator, java.util.Iterator<java.lang.Double> operands, java.lang.Object evaluationContext)
AbstractEvaluator
evaluate
in class AbstractEvaluator<java.lang.Double>
operator
- The operatoroperands
- The operandsevaluationContext
- The context of the evaluationprotected java.lang.Double evaluate(Function function, java.util.Iterator<java.lang.Double> arguments, java.lang.Object evaluationContext)
AbstractEvaluator
evaluate
in class AbstractEvaluator<java.lang.Double>
function
- The functionarguments
- The function's argumentsevaluationContext
- The context of the evaluation