Class DivideOperator
- java.lang.Object
-
- org.pentaho.reporting.libraries.formula.operators.AbstractNumericOperator
-
- org.pentaho.reporting.libraries.formula.operators.DivideOperator
-
- All Implemented Interfaces:
Serializable,InfixOperator
public class DivideOperator extends AbstractNumericOperator
A division operation. This operation expects two valid numbers.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.pentaho.reporting.libraries.formula.operators.AbstractNumericOperator
ZERO
-
-
Constructor Summary
Constructors Constructor Description DivideOperator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Numberevaluate(Number number1, Number number2)intgetLevel()booleanisAssociative()Defines, whether the operation is associative.booleanisLeftOperation()Defines the bind-direction of the operator.StringtoString()-
Methods inherited from class org.pentaho.reporting.libraries.formula.operators.AbstractNumericOperator
evaluate
-
-
-
-
Method Detail
-
evaluate
public Number evaluate(Number number1, Number number2) throws EvaluationException
- Specified by:
evaluatein classAbstractNumericOperator- Throws:
EvaluationException
-
getLevel
public int getLevel()
-
isLeftOperation
public boolean isLeftOperation()
Description copied from interface:InfixOperatorDefines the bind-direction of the operator. That direction defines, in which direction a sequence of equal operators is resolved.- Returns:
- true, if the operation is left-binding, false if right-binding
-
isAssociative
public boolean isAssociative()
Defines, whether the operation is associative. For associative operations, the evaluation order does not matter, if the operation appears more than once in an expression, and therefore we can optimize them a lot better than non-associative operations (ie. merge constant parts and precompute them once).- Returns:
- true, if the operation is associative, false otherwise
-
-