org.jfree.workbook
Class Cell

java.lang.Object
  |
  +--org.jfree.workbook.Cell
All Implemented Interfaces:
CellConstants, java.lang.Comparable
Direct Known Subclasses:
DateCell, FormulaCell, LabelCell, ValueCell

public class Cell
extends java.lang.Object
implements CellConstants, java.lang.Comparable

Represents one cell in a worksheet.


Field Summary
protected  int column
          The column number (0 to Worksheet.MAX_COLUMNS-1).
protected  java.lang.String content
          The cell contents.
protected  int row
          The row number (0 to Worksheet.MAX_ROWS-1).
protected  int type
          The type of data in the cell.
protected  java.lang.String valueFormat
          The value format (if required).
 
Fields inherited from interface org.jfree.workbook.CellConstants
DATE_TYPE, EXPRESSION_TYPE, LABEL_TYPE, VALUE_TYPE
 
Constructor Summary
protected Cell(int type, java.lang.String content, int row, int column)
          Constructs a new cell.
 
Method Summary
 int compareTo(java.lang.Object other)
          Implements the Comparable interface so that cells can easily be sorted.
 int getColumn()
          Returns the cell's column.
 java.lang.String getContent()
          Returns the cell's content.
 int getRow()
          Returns the cell's row.
protected  int getSerialNumber()
          Returns an integer that increases across columns and down rows.
 int getType()
          Returns the cell's type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

column

protected int column
The column number (0 to Worksheet.MAX_COLUMNS-1).


row

protected int row
The row number (0 to Worksheet.MAX_ROWS-1).


type

protected int type
The type of data in the cell. So far I know of: 30=date, 40=value, 60=label; For expressions, no value type is shown, so assume 0 for now.


content

protected java.lang.String content
The cell contents.


valueFormat

protected java.lang.String valueFormat
The value format (if required).

Constructor Detail

Cell

protected Cell(int type,
               java.lang.String content,
               int row,
               int column)
Constructs a new cell.

Parameters:
type - the cell type.
content - the cell contents.
row - the row.
column - the column.
Method Detail

getColumn

public int getColumn()
Returns the cell's column.

Returns:
The column.

getRow

public int getRow()
Returns the cell's row.

Returns:
The row.

getType

public int getType()
Returns the cell's type.

Returns:
The type.

getContent

public java.lang.String getContent()
Returns the cell's content.

Returns:
The content.

compareTo

public int compareTo(java.lang.Object other)
Implements the Comparable interface so that cells can easily be sorted.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
other - The object being compared to.
Returns:
An integer that indicates the relative order of the objects.

getSerialNumber

protected int getSerialNumber()
Returns an integer that increases across columns and down rows.

Returns:
A serial number for the cell.