org.jfree.report.expressions

Class AbstractExpression

Implemented Interfaces:
Cloneable, Expression, Serializable
Known Direct Subclasses:
ColumnAggregationExpression, FormulaExpression, FormulaFunction, GetValueExpression, GroupByExpression, IsEmptyDataExpression, IsEmptyExpression, IsEndOfDataExpression, IsExportTypeExpression, IsNullExpression

public abstract class AbstractExpression
extends java.lang.Object
implements Expression

A baseclass for simple, non-positionally parametrized expressions.
Author:
Thomas Morgner

Constructor Summary

AbstractExpression()

Method Summary

Object
clone()
Clones the expression, expression should be reinitialized after the cloning.
protected DataRow
getDataRow()
Returns the current DataRow.
Expression
getInstance()
Return a new instance of this expression.
String
getName()
Returns the name of the expression.
protected Locale
getParentLocale()
protected Configuration
getReportConfiguration()
protected ResourceBundleFactory
getResourceBundleFactory()
ExpressionRuntime
getRuntime()
boolean
isDeepTraversing()
A deep-traversing expression declares that it should receive updates from all subreports.
boolean
isPrecompute()
Returns, whether the expression will be precomputed.
boolean
isPreserve()
Checks, whether the expression's result should be preserved in the precomputed value registry.
void
setDeepTraversing(boolean deepTraversing)
Defines, whether the expression is deep-traversing.
void
setName(String name)
Sets the name of the expression.
void
setPrecompute(boolean precompute)
Defines, whether the expression will be precomputed.
void
setPreserve(boolean preserve)
Defines, whether the expression's result should be preserved in the precomputed value registry.
void
setRuntime(ExpressionRuntime runtime)
Defines the DataRow used in this expression.

Constructor Details

AbstractExpression

protected AbstractExpression()

Method Details

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
Returns:
A clone of this expression.

getDataRow

protected DataRow getDataRow()
Returns the current DataRow.
Returns:
the data row.

getInstance

public Expression getInstance()
Return a new instance of this expression. The copy is initialized and uses the same parameters as the original, but does not share any objects.
Specified by:
getInstance in interface Expression
Returns:
a copy of this function.

getName

public String getName()
Returns the name of the expression. An expression without a name cannot be referenced from outside the element.
Specified by:
getName in interface Expression
Returns:
the function name.

getParentLocale

protected Locale getParentLocale()

getReportConfiguration

protected Configuration getReportConfiguration()

getResourceBundleFactory

protected ResourceBundleFactory getResourceBundleFactory()

getRuntime

public ExpressionRuntime getRuntime()

isDeepTraversing

public boolean isDeepTraversing()
A deep-traversing expression declares that it should receive updates from all subreports. This mode should be activated if the expression's result depends on values contained in the subreport.
Specified by:
isDeepTraversing in interface Expression
Returns:
true, if the expression is deep-traversing, false otherwise.

isPrecompute

public boolean isPrecompute()
Returns, whether the expression will be precomputed. For precomputed expressions a parallel evaluation process is started and the result to which the expression evaluates before it gets out of scope will be used whenever an other expression queries this expression's value.
Specified by:
isPrecompute in interface Expression
Returns:
true, if the expression is precomputed, false otherwise.

isPreserve

public boolean isPreserve()
Checks, whether the expression's result should be preserved in the precomputed value registry. This way, the last value for that expression can be retrieved after the report has been finished. The preserve-function will only preserve the last value that has been evaluated before the expression went out of scope.
Specified by:
isPreserve in interface Expression
Returns:
true, if the expression's results should be preserved, false otherwise.

setDeepTraversing

public void setDeepTraversing(boolean deepTraversing)
Defines, whether the expression is deep-traversing.
Specified by:
setDeepTraversing in interface Expression
Parameters:
deepTraversing - true, if the expression is deep-traversing, false otherwise.

setName

public void setName(String name)
Sets the name of the expression.
Specified by:
setName in interface Expression
Parameters:
name - the name.

setPrecompute

public void setPrecompute(boolean precompute)
Defines, whether the expression will be precomputed. For precomputed expressions a parallel evaluation process is started and the result to which the expression evaluates before it gets out of scope will be used whenever an other expression queries this expression's value.
Specified by:
setPrecompute in interface Expression
Parameters:
precompute - true, if the expression is precomputed, false otherwise.

setPreserve

public void setPreserve(boolean preserve)
Defines, whether the expression's result should be preserved in the precomputed value registry. This way, the last value for that expression can be retrieved after the report has been finished.
Specified by:
setPreserve in interface Expression
Parameters:
preserve - true, if the expression's results should be preserved, false otherwise.

setRuntime

public void setRuntime(ExpressionRuntime runtime)
Defines the DataRow used in this expression. The dataRow is set when the report processing starts and can be used to access the values of functions, expressions and the reports datasource.
Specified by:
setRuntime in interface Expression
Parameters:
runtime - the runtime information for the expression