org.pentaho.reporting.libraries.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()
LValue[]getOperands()
InfixOperator[]getOperators()
LValuegetOptimizedHeadValue()
Allows access to the post optimized head value note that without the optimization, it's difficult to traverse libformula's object model.
ParsePositiongetParsePosition()
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 LValue[] getOperands()

getOperators

public InfixOperator[] 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

getParsePosition

public ParsePosition getParsePosition()

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()