Class Term
- java.lang.Object
-
- org.pentaho.reporting.libraries.formula.lvalues.AbstractLValue
-
- org.pentaho.reporting.libraries.formula.lvalues.Term
-
- All Implemented Interfaces:
Serializable,Cloneable,LValue
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
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()StringtoString(boolean root)-
Methods inherited from class org.pentaho.reporting.libraries.formula.lvalues.AbstractLValue
getContext, getValueType, setParsePosition
-
-
-
-
Constructor Detail
-
Term
public Term(LValue headValue)
-
-
Method Detail
-
evaluate
public TypeValuePair evaluate() throws EvaluationException
- Throws:
EvaluationException
-
add
public void add(InfixOperator operator, LValue operand)
-
initialize
public void initialize(FormulaContext context) throws EvaluationException
- Specified by:
initializein interfaceLValue- Overrides:
initializein classAbstractLValue- Throws:
EvaluationException
-
getChildValues
public LValue[] getChildValues()
Returns any dependent lvalues (parameters and operands, mostly).- Specified by:
getChildValuesin interfaceLValue- Overrides:
getChildValuesin classAbstractLValue- Returns:
-
toString
public String toString(boolean root)
-
isConstant
public boolean isConstant()
Checks whether the LValue is constant. Constant lvalues always return the same value.- Returns:
-
clone
public Object clone() throws CloneNotSupportedException
- Specified by:
clonein interfaceLValue- Overrides:
clonein classAbstractLValue- Throws:
CloneNotSupportedException
-
getOperands
public LValue[] getOperands()
-
getOperators
public InfixOperator[] getOperators()
-
getHeadValue
public LValue getHeadValue()
-
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()
- Specified by:
getParsePositionin interfaceLValue- Overrides:
getParsePositionin classAbstractLValue
-
-