org.jopendocument.dom.spreadsheet
Class Cell<D extends ODDocument>

java.lang.Object
  extended by org.jopendocument.dom.ODNode
      extended by org.jopendocument.dom.StyledNode<S,D>
          extended by org.jopendocument.dom.ImmutableDocStyledNode<S,D>
              extended by org.jopendocument.dom.spreadsheet.Cell<D>
Type Parameters:
D - type of document
Direct Known Subclasses:
MutableCell

public class Cell<D extends ODDocument>
extends ImmutableDocStyledNode<S,D>

A cell in a calc document. If you want to change a cell value you must obtain a MutableCell.

Author:
Sylvain

Method Summary
protected  boolean coversOtherCells()
           
 int getColumnsSpanned()
           
 String getError()
          Tries to find out if this cell computation resulted in an error.
 String getFormula()
           
protected  XMLVersion getNS()
           
protected  Row<D> getRow()
           
 int getRowsSpanned()
           
protected  String getStyleName()
           
protected  org.jdom.Namespace getTABLE()
           
 String getTextValue()
          Calls getTextValue(boolean) using getTextValueMode().
 String getTextValue(boolean ooMode)
          Return the text value of this cell.
static boolean getTextValueMode()
           
protected  String getType()
           
 Object getValue()
           
protected  org.jdom.Namespace getValueNS()
           
 ODValueType getValueType()
           
protected  boolean isCovered()
           
 boolean isEmpty()
           
 boolean isValid()
           
static void setTextValueMode(boolean ooMode)
          Set whether getTextValue() parses strings using the standard way or using the OpenOffice.org way.
 
Methods inherited from class org.jopendocument.dom.ImmutableDocStyledNode
getContent, getODDocument
 
Methods inherited from class org.jopendocument.dom.StyledNode
getPrivateStyle, getStyle, getStyle, getStyle, getStyle, getStyleDesc, getStyleDesc, getStyleDesc, getStyleStyleDesc, setStyleName, setStyleName
 
Methods inherited from class org.jopendocument.dom.ODNode
getElement, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

setTextValueMode

public static void setTextValueMode(boolean ooMode)
Set whether getTextValue() parses strings using the standard way or using the OpenOffice.org way.

Parameters:
ooMode - true if strings should be parsed the OO way.
See Also:
getTextValue(boolean)

getTextValueMode

public static boolean getTextValueMode()

getRow

protected final Row<D> getRow()

getNS

protected final XMLVersion getNS()

getValueNS

protected final org.jdom.Namespace getValueNS()

getType

protected final String getType()

getValueType

public final ODValueType getValueType()

getStyleName

protected String getStyleName()
Overrides:
getStyleName in class StyledNode<CellStyle,D extends ODDocument>

getValue

public Object getValue()

getTextValue

public String getTextValue()
Calls getTextValue(boolean) using getTextValueMode().

Returns:
a string for the content of this cell.

getTextValue

public String getTextValue(boolean ooMode)
Return the text value of this cell. This is often the formatted string of a value, e.g. "11 novembre 2009" for a date. This method doesn't just return the text content it also parses XML elements (like paragraphs, tabs and line-breaks). For the differences between the OO way (as of 3.1) and the OpenDocument way see section 5.1.1 White-space Characters of OpenDocument-v1.0-os and OpenDocument-v1.2-part1. In essence OpenOffice never trim strings.

Parameters:
ooMode - whether to use the OO way or the standard way.
Returns:
a string for the content of this cell.

getFormula

public final String getFormula()

getError

public String getError()
Tries to find out if this cell computation resulted in an error. This method cannot be robust since there's no error attribute in OpenDocument, we must match the value of the cell against a pattern. E.g. whether a cell has '=A0' for formula or '= "#N" & "/A"', this method will return a non-null error.

Returns:
the error or null.

isValid

public boolean isValid()

isCovered

protected final boolean isCovered()

isEmpty

public final boolean isEmpty()

getColumnsSpanned

public final int getColumnsSpanned()

getRowsSpanned

public final int getRowsSpanned()

coversOtherCells

protected final boolean coversOtherCells()

getTABLE

protected final org.jdom.Namespace getTABLE()


Copyright © 2010 jOpenDocument All Rights Reserved.