com.google.visualization.datasource.datatable
Class TableRow

java.lang.Object
  extended by com.google.visualization.datasource.datatable.TableRow

public class TableRow
extends java.lang.Object

A single row in a DataTable. The number of cells is expected to match the number of columns in the table, and the type of the value held in each cell is expected to match the type defined for the corresponding column.

Author:
Yoah B.D.

Constructor Summary
TableRow()
          Create an empty row list.
 
Method Summary
 void addCell(boolean value)
          Adds a boolean value of a single cell to the end of the row.
 void addCell(double value)
          Adds a numeric value of a single cell to the end of the row.
 void addCell(java.lang.String value)
          Adds a text value of a single cell to the end of the row.
 void addCell(TableCell cell)
          Adds a single cell to the end of the row.
 void addCell(Value value)
          Adds a value of a single cell to the end of the row.
 TableRow clone()
          Returns a clone of this TableRow.
 TableCell getCell(int index)
          Returns a single cell by its index.
 java.util.List<TableCell> getCells()
          Returns the list of all cell values.
 java.util.Map<java.lang.String,java.lang.String> getCustomProperties()
          Returns an immutable map of the custom properties.
 java.lang.String getCustomProperty(java.lang.String key)
          Retrieves a custom property.
 void setCustomProperty(java.lang.String propertyKey, java.lang.String propertyValue)
          Sets a custom property.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableRow

public TableRow()
Create an empty row list.

Method Detail

addCell

public void addCell(TableCell cell)
Adds a single cell to the end of the row.

Parameters:
cell - The cell's value.

addCell

public void addCell(Value value)
Adds a value of a single cell to the end of the row.

Parameters:
value - The inner value of the cell to add.

addCell

public void addCell(double value)
Adds a numeric value of a single cell to the end of the row.

Parameters:
value - The inner numeric value of the cell to add.

addCell

public void addCell(boolean value)
Adds a boolean value of a single cell to the end of the row.

Parameters:
value - The inner boolean value of the cell to add.

addCell

public void addCell(java.lang.String value)
Adds a text value of a single cell to the end of the row.

Parameters:
value - The inner text value of the cell to add.

getCells

public java.util.List<TableCell> getCells()
Returns the list of all cell values.

Returns:
The list of all cell values. The returned list is immutable.

getCell

public TableCell getCell(int index)
Returns a single cell by its index.

Parameters:
index - The index of the cell to get.
Returns:
A single cell by it's index.

getCustomProperty

public java.lang.String getCustomProperty(java.lang.String key)
Retrieves a custom property. Returns null if it does not exist.

Parameters:
key - The property key.
Returns:
The property value, or null if it does not exist.

setCustomProperty

public void setCustomProperty(java.lang.String propertyKey,
                              java.lang.String propertyValue)
Sets a custom property.

Parameters:
propertyKey - The property key.
propertyValue - The property value.

getCustomProperties

public java.util.Map<java.lang.String,java.lang.String> getCustomProperties()
Returns an immutable map of the custom properties.

Returns:
An immutable map of the custom properties.

clone

public TableRow clone()
Returns a clone of this TableRow. This is a deep clone.

Overrides:
clone in class java.lang.Object
Returns:
A clone of this TableRow.


Copyright © 2009 Google. All Rights Reserved.