org.jfree.formula.operators

Class PowerOperator

Implemented Interfaces:
InfixOperator, Serializable

public class PowerOperator
extends AbstractNumericOperator

This has to be implemented manually if we want to support arbitary precision. Damn, do I have to implement the logarithm computation as well? For now: Ignore that and use doubles!
Author:
Thomas Morgner

Field Summary

Fields inherited from class org.jfree.formula.operators.AbstractNumericOperator

ZERO

Constructor Summary

PowerOperator()

Method Summary

protected Number
evaluate(Number number1, Number number2)
int
getLevel()
boolean
isAssociative()
Defines, whether the operation is associative.
boolean
isLeftOperation()
String
toString()

Methods inherited from class org.jfree.formula.operators.AbstractNumericOperator

evaluate, evaluate

Constructor Details

PowerOperator

public PowerOperator()

Method Details

evaluate

protected Number evaluate(Number number1,
                          Number number2)
            throws EvaluationException
Overrides:
evaluate in interface AbstractNumericOperator

getLevel

public int getLevel()
Specified by:
getLevel in interface InfixOperator

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).
Specified by:
isAssociative in interface InfixOperator
Returns:
true, if the operation is associative, false otherwise

isLeftOperation

public boolean isLeftOperation()
Specified by:
isLeftOperation in interface InfixOperator

toString

public String toString()