## org.pentaho.reporting.libraries.formula.lvalues
Class Term

    java.lang.Object
      org.pentaho.reporting.libraries.formula.lvalues.AbstractLValue
          org.pentaho.reporting.libraries.formula.lvalues.Term

All Implemented Interfaces:
  java.io.Serializable, java.lang.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

Constructor Summary
`Term(LValue headValue)`

Method Summary
`void` `add(InfixOperator operator, LValue operand)`
`java.lang.Object` `clone()`
`TypeValuePair` `evaluate()`
`LValue[]` `getChildValues()` Returns any dependent lvalues (parameters and operands, mostly).
`LValue` `getHeadValue()`
`LValue[]` `getOperands()`
`InfixOperator[]` `getOperators()`
`LValue` `getOptimizedHeadValue()` Allows access to the post optimized head value note that without the optimization, it's difficult to traverse libformula's object model.
`ParsePosition` `getParsePosition()`
`void` `initialize(FormulaContext context)`
`boolean` `isConstant()` Checks whether the LValue is constant.
`java.lang.String` `toString()`

Methods inherited from class org.pentaho.reporting.libraries.formula.lvalues.AbstractLValue
`getContext, getValueType, setParsePosition`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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:
    `initialize` in interface `LValue`
  Overrides:
    `initialize` in class `AbstractLValue`
  Throws:
    `EvaluationException`

### getChildValues

    public LValue[] getChildValues()

  Returns any dependent lvalues (parameters and operands, mostly).

  Specified by:
    `getChildValues` in interface `LValue`
  Overrides:
    `getChildValues` in class `AbstractLValue`
  Returns:

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### isConstant

    public boolean isConstant()

  Checks whether the LValue is constant. Constant lvalues always return the same value.

  Returns:

### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

  Specified by:
    `clone` in interface `LValue`
  Overrides:
    `clone` in class `AbstractLValue`
  Throws:
    `java.lang.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:
    `getParsePosition` in interface `LValue`
  Overrides:
    `getParsePosition` in class `AbstractLValue`