fop 0.93

org.apache.fop.layoutmgr.table
Class TableRowIterator

java.lang.Object
  extended byorg.apache.fop.layoutmgr.table.TableRowIterator

public class TableRowIterator
extends java.lang.Object

Iterator that lets the table layout manager step over all of the rows of a part of the table (table-header, table-footer or table-body).

Note: This class is not thread-safe.


Field Summary
static int BODY
          Selects the table-body elements for iteration.
static int FOOTER
          Selects the table-footer elements for iteration.
static int HEADER
          Selects the table-header elements for iteration.
protected  Table table
          The table on which this instance operates.
 
Constructor Summary
TableRowIterator(Table table, ColumnSetup columns, int tablePart)
          Creates a new TableRowIterator.
 
Method Summary
 void backToPreviousRow()
          Sets the iterator to the previous row.
 org.apache.fop.layoutmgr.table.EffRow getCachedRow(int index)
          Returns a cached effective row.
 org.apache.fop.layoutmgr.table.EffRow getFirstRow()
          Returns the first effective row.
 org.apache.fop.layoutmgr.table.EffRow getFollowingRow(org.apache.fop.layoutmgr.table.EffRow row)
          Returns the row following the given row, without moving the iterator.
 org.apache.fop.layoutmgr.table.EffRow getLastRow()
          Returns the last effective row.
 org.apache.fop.layoutmgr.table.EffRow[] getNextRowGroup()
          Returns the next row group if any.
 org.apache.fop.layoutmgr.table.EffRow getPrecedingRow(org.apache.fop.layoutmgr.table.EffRow row)
          Returns the row preceding the given row, without moving the iterator.
 void prefetchAll()
          Preloads the whole table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BODY

public static final int BODY
Selects the table-body elements for iteration.

See Also:
Constant Field Values

HEADER

public static final int HEADER
Selects the table-header elements for iteration.

See Also:
Constant Field Values

FOOTER

public static final int FOOTER
Selects the table-footer elements for iteration.

See Also:
Constant Field Values

table

protected Table table
The table on which this instance operates.

Constructor Detail

TableRowIterator

public TableRowIterator(Table table,
                        ColumnSetup columns,
                        int tablePart)
Creates a new TableRowIterator.

Parameters:
table - the table to iterate over
columns - the column setup for the table
tablePart - indicates what part of the table to iterate over (HEADER, FOOTER, BODY)
Method Detail

prefetchAll

public void prefetchAll()
Preloads the whole table.

Note:This is inefficient for large tables.


getNextRowGroup

public org.apache.fop.layoutmgr.table.EffRow[] getNextRowGroup()
Returns the next row group if any. A row group in this context is the minimum number of consecutive rows which contains all spanned grid units of its cells.

Returns:
the next row group, or null

getPrecedingRow

public org.apache.fop.layoutmgr.table.EffRow getPrecedingRow(org.apache.fop.layoutmgr.table.EffRow row)
Returns the row preceding the given row, without moving the iterator.

Parameters:
row - a row in the iterated table part
Returns:
the preceding row, or null if there is no such row (the given row is the first one in the table part)

getFollowingRow

public org.apache.fop.layoutmgr.table.EffRow getFollowingRow(org.apache.fop.layoutmgr.table.EffRow row)
Returns the row following the given row, without moving the iterator.

Parameters:
row - a row in the iterated table part
Returns:
the following row, or null if there is no more row

backToPreviousRow

public void backToPreviousRow()
Sets the iterator to the previous row.


getFirstRow

public org.apache.fop.layoutmgr.table.EffRow getFirstRow()
Returns the first effective row.

Returns:
the requested effective row.

getLastRow

public org.apache.fop.layoutmgr.table.EffRow getLastRow()
Returns the last effective row.

Note:This is inefficient for large tables because the whole table if preloaded.

Returns:
the requested effective row.

getCachedRow

public org.apache.fop.layoutmgr.table.EffRow getCachedRow(int index)
Returns a cached effective row. If the given index points outside the range of rows (negative or greater than the number of already fetched rows), this methods terminates nicely by returning null.

Parameters:
index - index of the row (zero-based)
Returns:
the requested effective row or null if (index < 0 || index >= the number of already fetched rows)

fop 0.93

Copyright 1999-2006 The Apache Software Foundation. All Rights Reserved.