public class DoubleEvaluator extends AbstractEvaluator<Double>
Modifier and Type | Class and Description |
---|---|
static class |
DoubleEvaluator.Style
The order or operations (operator precedence) is not clearly defined, especially between the unary minus operator and exponentiation
operator (see http://en.wikipedia.org/wiki/Order_of_operations).
|
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 in the standard operator precedence.
|
static Operator |
NEGATE_HIGH
The negate unary operator in the Excel like operator precedence.
|
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 Double |
evaluate(Constant constant,
Object evaluationContext)
Evaluates a constant.
|
protected Double |
evaluate(Function function,
Iterator<Double> arguments,
Object evaluationContext)
Evaluates a function.
|
protected Double |
evaluate(Operator operator,
Iterator<Double> operands,
Object evaluationContext)
Evaluates an operation.
|
static Parameters |
getDefaultParameters()
Gets a copy of DoubleEvaluator standard default parameters.
|
static Parameters |
getDefaultParameters(DoubleEvaluator.Style style)
Gets a copy of DoubleEvaluator default parameters.
|
protected Double |
toValue(String literal,
Object evaluationContext)
Evaluates a literal (Converts it to a value).
|
evaluate, evaluate, getConstants, getFunctions, getOperators, guessOperator, tokenize, 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 NEGATE_HIGH
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()
DoubleEvaluator.Style
public static Parameters getDefaultParameters(DoubleEvaluator.Style style)
protected Double toValue(String literal, Object evaluationContext)
AbstractEvaluator
toValue
in class AbstractEvaluator<Double>
literal
- The literal to evaluate.evaluationContext
- The context of the evaluationprotected Double evaluate(Constant constant, Object evaluationContext)
AbstractEvaluator
evaluate
in class AbstractEvaluator<Double>
constant
- The constantevaluationContext
- The context of the evaluationprotected Double evaluate(Operator operator, Iterator<Double> operands, Object evaluationContext)
AbstractEvaluator
evaluate
in class AbstractEvaluator<Double>
operator
- The operatoroperands
- The operandsevaluationContext
- The context of the evaluationprotected Double evaluate(Function function, Iterator<Double> arguments, Object evaluationContext)
AbstractEvaluator
evaluate
in class AbstractEvaluator<Double>
function
- The functionarguments
- The function's argumentsevaluationContext
- The context of the evaluationCopyright © 2014. All Rights Reserved.