org.jfree.report
Interface DataRow

All Known Implementing Classes:
DataRowConnector

public interface DataRow

The datarow is used to access the current row in the TableModel, Expressions and Functions using a generic interface. The DataRow is able to detect deadlocks and to check function depencies.

The DataRows depends on a unmodifiable row structure, so it is forbidden to add new functions and expressions to the report or to modify the tablemodel after the report processing has started.

ReportProperties can only be queried if they are marked. Marked properties get enumerated when the report processing starts. Marking properties after that point has no effect. Removing the property will not remove the column from this datarow, this DataRow's column will return null when queried in that case.

Author:
Thomas Morgner
See Also:
Expression, Function, TableModel

Method Summary
 int findColumn(java.lang.String name)
          Returns the column position of the column, expression or function with the given name or -1 if the given name does not exist in this DataRow.
 java.lang.Object get(int col)
          Returns the value of the function, expression or column in the tablemodel using the column number.
 java.lang.Object get(java.lang.String col)
          Returns the value of the function, expression or column using its specific name.
 int getColumnCount()
          Returns the number of columns, expressions and functions and marked ReportProperties in the report.
 java.lang.String getColumnName(int col)
          Returns the name of the column, expression or function.
 

Method Detail

get

public java.lang.Object get(int col)
Returns the value of the function, expression or column in the tablemodel using the column number. 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.

get

public java.lang.Object get(java.lang.String col)
                     throws java.lang.IllegalStateException
Returns the value of the function, expression 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:
java.lang.IllegalStateException - if the datarow detected a deadlock.

getColumnName

public java.lang.String getColumnName(int col)
Returns the name of the column, expression 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.

findColumn

public int findColumn(java.lang.String name)
Returns the column position of the column, expression or function with the given name or -1 if the given name does not exist in this DataRow.

Parameters:
name - the item name.
Returns:
the item index.

getColumnCount

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

Returns:
the item count.