org.jfree.workbook
Class Row

java.lang.Object
  |
  +--org.jfree.workbook.Row
All Implemented Interfaces:
java.lang.Comparable

public class Row
extends java.lang.Object
implements java.lang.Comparable

Represents a single row of cells in a worksheet.


Field Summary
protected  java.util.List cells
          The cells in the row.
protected  int index
          The row index (0 to Worksheet.MAX_ROWS).
 
Constructor Summary
Row(int index)
          Constructs an empty row with the specified index.
 
Method Summary
 void add(Cell cell)
          Adds a cell to the row, replacing the existing cell if any.
 int compareTo(java.lang.Object other)
          Implements the Comparator interface so that the rows can easily be sorted into order.
 Cell get(int column)
          Returns the cell at the specified column.
 java.util.Iterator getCellsIterator()
          Returns an iterator that provides access to the cells in the row.
 int getIndex()
          Returns the index of the row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

protected int index
The row index (0 to Worksheet.MAX_ROWS).


cells

protected java.util.List cells
The cells in the row.

Constructor Detail

Row

public Row(int index)
Constructs an empty row with the specified index.

Parameters:
index - the row index.
Method Detail

getIndex

public int getIndex()
Returns the index of the row.

Returns:
The index of the row.

getCellsIterator

public java.util.Iterator getCellsIterator()
Returns an iterator that provides access to the cells in the row.

Returns:
The iterator.

add

public void add(Cell cell)
Adds a cell to the row, replacing the existing cell if any. Cells are be maintained in column order.

Parameters:
cell - the cell to add.

get

public Cell get(int column)
Returns the cell at the specified column.

Parameters:
column - the column.
Returns:
The cell at the specified column.

compareTo

public int compareTo(java.lang.Object other)
Implements the Comparator interface so that the rows can easily be sorted into order.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - the object to compare against.
Returns:
An int that indicates the relative order of the objects.