public class

Cell

extends Object
implements Extension
java.lang.Object
   ↳ com.google.gdata.data.spreadsheet.Cell

Class Overview

GData schema extension describing a spreadsheet formula.

Summary

Fields
private int col The positional column number starting with 1 (-1 for unspecified).
private String inputValue The formula of the cell (null if the formula is omitted).
private Number numericValue The calculated numeric value of this cell.
private int row The positional row number starting with 1 (-1 for unspecified)
private String value The evaluated value of the cell in String from (null if unspecified).
Public Constructors
Cell()
Initializes to blank for XML parsing.
Cell(int inRow, int inCol, String inInputValue)
Initializes a cell where the column is known.
Public Methods
static Cell createFullCell(int inRow, int inCol, String inInputValue, Number inCalculatedValue, 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(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, String namespace, String localName, Attributes attrs)
Yields an XML handler for parsing a Cell element.
String getInputValue()
Yields the formula reference of the cell.
Number getNumericValue()
Gets the calculated numeric value.
int getRow()
Yields the positional row number starting with 1.
String getValue()
Yields the evaluated, formatted value of this cell.
Cell withNewInputValue(String newInputValue)
Creates a new cell with a new input value, for the purpose of updating.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.google.gdata.data.Extension

Fields

private int col

The positional column number starting with 1 (-1 for unspecified).

private String inputValue

The formula of the cell (null if the formula is omitted).

private Number numericValue

The calculated numeric value of this cell.

private int row

The positional row number starting with 1 (-1 for unspecified)

private String value

The evaluated value of the cell in String from (null if unspecified).

Public Constructors

public Cell ()

Initializes to blank for XML parsing.

public Cell (int inRow, int inCol, 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)

Public Methods

public static Cell createFullCell (int inRow, int inCol, String inInputValue, Number inCalculatedValue, String inValue)

Creates a cell for the server library; it is not appropriate for client side use (the server may reject these cells).

Parameters
inRow
inCol
inInputValue
inCalculatedValue
inValue

public void generate (XmlWriter w, ExtensionProfile extProfile)

Writes this cell as XML, omitting any unspecified fields.

Parameters
w XML writer
extProfile Extension profile
Throws
IOException

public int getCol ()

Yields the column number starting with 1.

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

public static ExtensionDescription getDefaultDescription (boolean repeats)

Returns the suggested extension description.

Parameters
repeats Whether this cell might be repeated in parent context

public double getDoubleValue ()

Gets the double-precision value.

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

public XmlParser.ElementHandler getHandler (ExtensionProfile extProfile, String namespace, String localName, Attributes attrs)

Yields an XML handler for parsing a Cell element.

Parameters
extProfile Extension profile
namespace Extension namespace
localName Tag name, without the namespace prefix
attrs Tag attributes
Returns
  • an element handler
Throws
IOException
ParseException

public 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.

public Number getNumericValue ()

Gets the calculated numeric value.

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

public int getRow ()

Yields the positional row number starting with 1.

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

public String getValue ()

Yields the evaluated, formatted value of this cell.

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

public Cell withNewInputValue (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