org.pentaho.reporting.libraries.formula.operators

Class DivideOperator

public class DivideOperator extends AbstractNumericOperator

A division operation. This operation expects two valid numbers.

Author: Thomas Morgner

Constructor Summary
DivideOperator()
Method Summary
static BigDecimaldivide(BigDecimal bd1, BigDecimal bd2)
Numberevaluate(Number number1, Number number2)
intgetLevel()
booleanisAssociative()
Defines, whether the operation is associative.
booleanisLeftOperation()
StringtoString()

Constructor Detail

DivideOperator

public DivideOperator()

Method Detail

divide

public static BigDecimal divide(BigDecimal bd1, BigDecimal bd2)

evaluate

public Number evaluate(Number number1, Number number2)

getLevel

public int getLevel()

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

isLeftOperation

public boolean isLeftOperation()

toString

public String toString()