com.jrefinery.workbook
Class Row
java.lang.Object
|
+--com.jrefinery.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.ArrayList |
cells
The cells in the row. |
protected int |
index
The row index (0 to Worksheet.MAX_ROWS). |
|
Constructor Summary |
Row(int index)
Standard constructor: creates 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. |
int |
getIndex()
Returns the index of the row. |
void |
writeRow(java.io.PrintStream out,
java.lang.String indent)
Writes a row element to the stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
index
protected int index
- The row index (0 to Worksheet.MAX_ROWS).
cells
protected java.util.ArrayList cells
- The cells in the row.
Row
public Row(int index)
- Standard constructor: creates an empty row with the specified index.
- Parameters:
The - row index.
getIndex
public int getIndex()
- Returns the index of the row.
- Returns:
- The index of the row.
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.
writeRow
public void writeRow(java.io.PrintStream out,
java.lang.String indent)
- Writes a row element to the stream.
- Parameters:
out - The output stream.indent - The indentation.