com.arctorus.documents.table
Class Cell

java.lang.Object
  extended by com.arctorus.documents.table.Cell
Direct Known Subclasses:
MergedCell

public class Cell
extends java.lang.Object

Table cell. Contains text, style and collection of borders.
By default cell doesn't contain a text. Style is set to default.

See Also:
Run, CellStyle

Field Summary
static Cell NULL
          NULL cell.
 
Method Summary
 void addRun(Run run)
          Add new text run to the cell.
 boolean equalContent(Cell cell)
          Indicates whether the content of the specified cell (style, borders and text) is "equal to" the content of this cell.
 CellBorders getBorders()
          Get borders for the cell.
 int getColumnIndex()
          Get zero based column index of the cell in a table.
 int getRowIndex()
          Get zero based row index of the cell in a table.
 java.util.List<Run> getRuns()
          Get list of text runs of the cell.
 CellStyleId getStyleId()
          Get style id of the cell.
 boolean hasBorders()
          Determines whether the cell has any borders.
 boolean hasText()
          Return true if the cell has text runs.
 void setRuns(java.util.List<Run> runs)
          Set text in the cell.
 void setStyle(CellStyle cellStyle)
          Set new style of the cell.
 void setStyleId(CellStyleId styleId)
          Set new style id of the cell.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final Cell NULL
NULL cell.

Method Detail

getRowIndex

public int getRowIndex()
Get zero based row index of the cell in a table.


getColumnIndex

public int getColumnIndex()
Get zero based column index of the cell in a table.


getRuns

public java.util.List<Run> getRuns()
Get list of text runs of the cell.


hasText

public boolean hasText()
Return true if the cell has text runs.


setRuns

public void setRuns(java.util.List<Run> runs)
Set text in the cell.

Parameters:
runs - list of text runs to set. If runs parameter is null then do nothing.

addRun

public void addRun(Run run)
Add new text run to the cell.

Parameters:
run - text run to add.

getStyleId

public CellStyleId getStyleId()
Get style id of the cell.


setStyleId

public void setStyleId(CellStyleId styleId)
Set new style id of the cell.

Parameters:
styleId - new style id of the cell.

setStyle

public void setStyle(CellStyle cellStyle)
Set new style of the cell.

Parameters:
cellStyle - new cell style.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object

equalContent

public boolean equalContent(Cell cell)
Indicates whether the content of the specified cell (style, borders and text) is "equal to" the content of this cell.

Parameters:
cell - cell to compare with this one.

getBorders

public CellBorders getBorders()
Get borders for the cell.


hasBorders

public boolean hasBorders()
Determines whether the cell has any borders.