org.jfree.report.data

Class ExpressionDataRow

public final class ExpressionDataRow extends Object implements DataRow

A datarow for all expressions encountered in the report. This datarow is a stack-like structure, which allows easy adding and removing of expressions, even if these expressions have been cloned and or otherwisely modified.

Author: Thomas Morgner

Constructor Summary
ExpressionDataRow(GlobalMasterRow masterRow, ReportContext reportContext, int capacity)
Method Summary
ExpressionDataRowadvance(GlobalMasterRow master, boolean deepTraversing)
Advances to the next row and attaches the given master row to the objects contained in that client data row.
ExpressionDataRowderive(GlobalMasterRow master)
Objectget(int col)
Returns the value of the expressions or column in the tablemodel using the given column number as index.
Objectget(String col)
Returns the value of the function, expressions or column using its specific name.
intgetColumnCount()
Returns the number of columns, expressions and functions and marked ReportProperties in the report.
StringgetColumnName(int col)
Returns the name of the column, expressions or function.
DataFlagsgetFlags(String col)
DataFlagsgetFlags(int col)
ExpressionSlot[]getSlots()
voidpopExpression()
voidpopExpressions(int counter)
voidpushExpression(ExpressionSlot expressionSlot)
This adds the expression to the data-row and queries the expression for the first time.
voidpushExpressions(ExpressionSlot[] expressionSlots)

Constructor Detail

ExpressionDataRow

public ExpressionDataRow(GlobalMasterRow masterRow, ReportContext reportContext, int capacity)

Method Detail

advance

public ExpressionDataRow advance(GlobalMasterRow master, boolean deepTraversing)
Advances to the next row and attaches the given master row to the objects contained in that client data row.

Parameters: master deepTraversing only advance expressions that have been marked as deeply traversing

Returns:

derive

public ExpressionDataRow derive(GlobalMasterRow master)

get

public Object get(int col)
Returns the value of the expressions or column in the tablemodel using the given column number as index. For functions and expressions, the getValue() method is called and for columns from the tablemodel the tablemodel method getValueAt(row, column) gets called.

Parameters: col the item index.

Returns: the value.

Throws: IllegalStateException if the datarow detected a deadlock.

get

public Object get(String col)
Returns the value of the function, expressions or column using its specific name. The given name is translated into a valid column number and the the column is queried. For functions and expressions, the getValue() method is called and for columns from the tablemodel the tablemodel method getValueAt(row, column) gets called.

Parameters: col the item index.

Returns: the value.

Throws: IllegalStateException if the datarow detected a deadlock.

getColumnCount

public int getColumnCount()
Returns the number of columns, expressions and functions and marked ReportProperties in the report.

Returns: the item count.

getColumnName

public String getColumnName(int col)
Returns the name of the column, expressions or function. For columns from the tablemodel, the tablemodels getColumnName method is called. For functions, expressions and report properties the assigned name is returned.

Parameters: col the item index.

Returns: the name.

getFlags

public DataFlags getFlags(String col)

getFlags

public DataFlags getFlags(int col)

getSlots

public ExpressionSlot[] getSlots()

popExpression

public void popExpression()

popExpressions

public void popExpressions(int counter)

pushExpression

public void pushExpression(ExpressionSlot expressionSlot)
This adds the expression to the data-row and queries the expression for the first time.

Parameters: ex rd

Throws: DataSourceException

pushExpressions

public void pushExpressions(ExpressionSlot[] expressionSlots)