org.jfree.formula.lvalues

Class Term

public class Term extends AbstractLValue

An term is a list of LValues connected by operators. For the sake of efficiency, this is not stored as tree. We store the term as a list in the following format: (headValue)(OP value)* ...

Author: Thomas Morgner

Constructor Summary
Term(LValue headValue)
Method Summary
voidadd(InfixOperator operator, LValue operand)
Objectclone()
TypeValuePairevaluate()
LValue[]getChildValues()
Returns any dependent lvalues (parameters and operands, mostly).
LValuegetHeadValue()
InfixOperator[]getOperands()
LValue[]getOperators()
LValuegetOptimizedHeadValue()
Allows access to the post optimized head value note that without the optimization, it's difficult to traverse libformula's object model.
LValue[]getOptimizedOperands()
Allows access to the post optimized operand array
InfixOperator[]getOptimizedOperators()
Allows access to the post optimized operator array
voidinitialize(FormulaContext context)
booleanisConstant()
Checks, whether the LValue is constant.
StringtoString()

Constructor Detail

Term

public Term(LValue headValue)

Method Detail

add

public void add(InfixOperator operator, LValue operand)

clone

public Object clone()

evaluate

public TypeValuePair evaluate()

getChildValues

public LValue[] getChildValues()
Returns any dependent lvalues (parameters and operands, mostly).

Returns:

getHeadValue

public LValue getHeadValue()

getOperands

public InfixOperator[] getOperands()

getOperators

public LValue[] getOperators()

getOptimizedHeadValue

public LValue getOptimizedHeadValue()
Allows access to the post optimized head value note that without the optimization, it's difficult to traverse libformula's object model.

Returns: optimized head value

getOptimizedOperands

public LValue[] getOptimizedOperands()
Allows access to the post optimized operand array

Returns: optimized operand array

getOptimizedOperators

public InfixOperator[] getOptimizedOperators()
Allows access to the post optimized operator array

Returns: optimized operator array

initialize

public void initialize(FormulaContext context)

isConstant

public boolean isConstant()
Checks, whether the LValue is constant. Constant lvalues always return the same value.

Returns:

toString

public String toString()