Google Data APIs Client Library (1.41.1)



com.google.gdata.data.spreadsheet
Class Cell

java.lang.Object
  extended by com.google.gdata.data.spreadsheet.Cell
All Implemented Interfaces:
Extension

public class Cell
extends java.lang.Object
implements Extension

GData schema extension describing a spreadsheet formula.


Constructor Summary
Cell()
          Initializes to blank for XML parsing.
Cell(int inRow, int inCol, java.lang.String inInputValue)
          Initializes a cell where the column is known.
 
Method Summary
static Cell createFullCell(int inRow, int inCol, java.lang.String inInputValue, java.lang.Number inCalculatedValue, java.lang.String inValue)
          Creates a cell for the server library; it is not appropriate for client side use (the server may reject these cells).
 void generate(com.google.gdata.util.common.xml.XmlWriter w, ExtensionProfile extProfile)
          Writes this cell as XML, omitting any unspecified fields.
 int getCol()
          Yields the column number starting with 1.
static ExtensionDescription getDefaultDescription(boolean repeats)
          Returns the suggested extension description.
 double getDoubleValue()
          Gets the double-precision value.
 XmlParser.ElementHandler getHandler(ExtensionProfile extProfile, java.lang.String namespace, java.lang.String localName, org.xml.sax.Attributes attrs)
          Yields an XML handler for parsing a Cell element.
 java.lang.String getInputValue()
          Yields the formula reference of the cell.
 java.lang.Number getNumericValue()
          Gets the calculated numeric value.
 int getRow()
          Yields the positional row number starting with 1.
 java.lang.String getValue()
          Yields the evaluated, formatted value of this cell.
 Cell withNewInputValue(java.lang.String newInputValue)
          Creates a new cell with a new input value, for the purpose of updating.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cell

public Cell()
Initializes to blank for XML parsing.


Cell

public Cell(int inRow,
            int inCol,
            java.lang.String inInputValue)
Initializes a cell where the column is known.

Parameters:
inRow - the row number starting with 1 (-1 for unspecified)
inCol - the column number starting with 1 (-1 for unspecified)
inInputValue - the formula (null for unspecified)
Method Detail

createFullCell

public static Cell createFullCell(int inRow,
                                  int inCol,
                                  java.lang.String inInputValue,
                                  java.lang.Number inCalculatedValue,
                                  java.lang.String inValue)
Creates a cell for the server library; it is not appropriate for client side use (the server may reject these cells).


getRow

public int getRow()
Yields the positional row number starting with 1.

Returns:
the row number, or -1 if the row is not specified

getCol

public int getCol()
Yields the column number starting with 1.

Returns:
the positional column number, or -1 if the column is not specified

getInputValue

public java.lang.String getInputValue()
Yields the formula reference of the cell. An "=" sign signifies that there is a formula computed on the fly. Otherwise it is simply data that is entered into the sheet.


getNumericValue

public java.lang.Number getNumericValue()
Gets the calculated numeric value.

Returns:
the raw numeric value, or null if it is non-numeric

getDoubleValue

public double getDoubleValue()
Gets the double-precision value.

Returns:
the double value, or Double.NaN if no number specified

getValue

public java.lang.String getValue()
Yields the evaluated, formatted value of this cell.

Returns:
the evaluated and formatted value (null if not specified)

withNewInputValue

public Cell withNewInputValue(java.lang.String newInputValue)
Creates a new cell with a new input value, for the purpose of updating. The new cell cannot contain a calculation result value, because values cannot be updated.

Parameters:
newInputValue - the new input value, starting with '=' for a formula, otherwise just a plain string
Returns:
a newly created "cell" object

getDefaultDescription

public static ExtensionDescription getDefaultDescription(boolean repeats)
Returns the suggested extension description.

Parameters:
repeats - whether this cell might be repeated in parent context

generate

public void generate(com.google.gdata.util.common.xml.XmlWriter w,
                     ExtensionProfile extProfile)
              throws java.io.IOException
Writes this cell as XML, omitting any unspecified fields.

Specified by:
generate in interface Extension
Parameters:
w - XML writer
extProfile - extension profile
Throws:
java.io.IOException

getHandler

public XmlParser.ElementHandler getHandler(ExtensionProfile extProfile,
                                           java.lang.String namespace,
                                           java.lang.String localName,
                                           org.xml.sax.Attributes attrs)
                                    throws ParseException,
                                           java.io.IOException
Yields an XML handler for parsing a Cell element.

Specified by:
getHandler in interface Extension
Parameters:
extProfile - extension profile
namespace - extension namespace
localName - tag name, without the namespace prefix
attrs - tag attributes
Returns:
an element handler
Throws:
ParseException - when an unexpected tag or badly-formatted XML is detected
java.io.IOException