Package org.jfree.report.expressions

# Class FormulaFunction

java.lang.Object
org.jfree.report.expressions.AbstractExpression
org.jfree.report.expressions.FormulaFunction

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Expression`, `Function`

public class FormulaFunction extends AbstractExpression implements Function
Creation-Date: 04.11.2006, 19:24:04

Author:
  Thomas Morgner
See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`FormulaFunction()`

## Method Summary

Modifier and Type
Method
Description
`Function`
`advance()`
When the advance method is called, the function is asked to perform the next step of its computation.
`Object`
`clone()`
Clones the expression, expression should be reinitialized after the cloning.
`Object`
`computeValue()`
Return the current expression value.
`org.pentaho.reporting.libraries.formula.Formula`
`getCompiledFormula()`
Returns the compiled formula.
`String`
`getFormula()`
`String`
`getFormulaExpression()`
`String`
`getFormulaNamespace()`
`String`
`getInitial()`
`String`
`getInitialExpression()`
`String`
`getInitialNamespace()`
`void`
`setFormula(String formula)`
`void`
`setInitial(String initial)`

### Methods inherited from class org.jfree.report.expressions.AbstractExpression

`getDataRow, getInstance, getName, getParentLocale, getReportConfiguration, getResourceBundleFactory, getRuntime, isDeepTraversing, isPrecompute, isPreserve, setDeepTraversing, setName, setPrecompute, setPreserve, setRuntime`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.jfree.report.expressions.Expression

`getInstance, getName, isDeepTraversing, isPrecompute, isPreserve, setDeepTraversing, setName, setPrecompute, setPreserve, setRuntime`

## Constructor Details

### FormulaFunction

public FormulaFunction()

## Method Details

### getInitial

public String getInitial()

### getInitialExpression

public String getInitialExpression()

### getInitialNamespace

public String getInitialNamespace()

### setInitial

public void setInitial(String initial)

### getFormula

public String getFormula()

### getFormulaNamespace

public String getFormulaNamespace()

### getFormulaExpression

public String getFormulaExpression()

### setFormula

public void setFormula(String formula)

### advance

public Function advance() throws DataSourceException
When the advance method is called, the function is asked to perform the next step of its computation.

The original function must not be altered during that step (or more correctly, calling advance on the original expression again must not return a different result).

Specified by:
  `advance` in interface `Function`
Returns:
  a copy of the function containing the new state.
Throws:
  `DataSourceException`

### computeValue

public Object computeValue() throws DataSourceException
Return the current expression value.

The value depends (obviously) on the expression implementation.

Specified by:
  `computeValue` in interface `Expression`
Returns:
  the value of the function.
Throws:
  `DataSourceException`

### clone

public Object clone() throws CloneNotSupportedException
Clones the expression, expression should be reinitialized after the cloning.

Expression maintain no state, cloning is done at the beginning of the report processing to disconnect the used expression from any other object space.

Specified by:
  `clone` in interface `Expression`
Overrides:
  `clone` in class `AbstractExpression`
Returns:
  A clone of this expression.
Throws:
  `CloneNotSupportedException` - this should never happen.

### getCompiledFormula

public org.pentaho.reporting.libraries.formula.Formula getCompiledFormula() throws org.pentaho.reporting.libraries.formula.parser.ParseException
Returns the compiled formula. The formula is not connected to a formula context.

Returns:
  the formula.
Throws:
  `org.pentaho.reporting.libraries.formula.parser.ParseException` - if the formula contains syntax errors.