com.google.visualization.datasource.datatable
Class TableCell

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

public class TableCell
extends java.lang.Object

A single cell in a DataTable. Contains a value, a formatted value, and a dictionary of custom properties. The value should match the type of the column in which it resides. See ColumnDescription. The formatted value is used for display purposes. The custom properties can be used for any purpose.

Author:
Yoah B.D.

Constructor Summary
TableCell(boolean value)
          Constructs a new TableCell with a boolean value.
TableCell(double value)
          Constructs a new TableCell with a number value.
TableCell(java.lang.String value)
          Constructs a new TableCell with a text value.
TableCell(TableCell other)
          Copy constructor.
TableCell(Value value)
          Construct a new TableCell with the parameter as the inner value.
TableCell(Value value, java.lang.String formattedValue)
          Construct a new TableCell with the parameter as the inner value and with a FormattedValue representing this.value.
 
Method Summary
 TableCell clone()
          Returns a copy of this TableCell.
 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.
 java.lang.String getFormattedValue()
          Returns the formatted value of this cell.
static java.util.Comparator<TableCell> getLocalizedComparator(com.ibm.icu.util.ULocale ulocale)
          Returns a comparator that compares table cells according to their inner values and, in the case of text values, according to a given locale.
 ValueType getType()
          Returns the type of this cell.
 Value getValue()
          Returns the inner value of this cell.
 boolean isNull()
          Tests whether this cell's value is a logical null.
 void setCustomProperty(java.lang.String propertyKey, java.lang.String propertyValue)
          Sets a custom property.
 void setFormattedValue(java.lang.String formattedValue)
          Set a formatted value for the value in this table cell.
 java.lang.String toString()
          Returns the String representation of the inner value.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableCell

public TableCell(Value value)
Construct a new TableCell with the parameter as the inner value.

Parameters:
value - The inner value of this cell.

TableCell

public TableCell(Value value,
                 java.lang.String formattedValue)
Construct a new TableCell with the parameter as the inner value and with a FormattedValue representing this.value.

Parameters:
value - The inner value of this cell.
formattedValue - The formatted form of this value.

TableCell

public TableCell(TableCell other)
Copy constructor.

Parameters:
other - The other table cell to construct from.

TableCell

public TableCell(java.lang.String value)
Constructs a new TableCell with a text value.

Parameters:
value - The inner text value of this cell.

TableCell

public TableCell(boolean value)
Constructs a new TableCell with a boolean value.

Parameters:
value - The inner boolean value of this cell.

TableCell

public TableCell(double value)
Constructs a new TableCell with a number value.

Parameters:
value - The inner number value of this cell.
Method Detail

getLocalizedComparator

public static java.util.Comparator<TableCell> getLocalizedComparator(com.ibm.icu.util.ULocale ulocale)
Returns a comparator that compares table cells according to their inner values and, in the case of text values, according to a given locale.

Parameters:
ulocale - The ULocale defining the order relation of text values.
Returns:
A comparator that compares table cells according to their inner values and, in the case of text values, according to a given locale.

getFormattedValue

public java.lang.String getFormattedValue()
Returns the formatted value of this cell.

Returns:
The formatted value of this cell.

setFormattedValue

public void setFormattedValue(java.lang.String formattedValue)
Set a formatted value for the value in this table cell.

Parameters:
formattedValue - The formatted value to set.

getValue

public Value getValue()
Returns the inner value of this cell.

Returns:
The inner value of this cell.

getType

public ValueType getType()
Returns the type of this cell.

Returns:
The type of this cell.

isNull

public boolean isNull()
Tests whether this cell's value is a logical null.

Returns:
Indication whether the call's value is null.

toString

public java.lang.String toString()
Returns the String representation of the inner value.

Overrides:
toString in class java.lang.Object
Returns:
The String representation of the inner value.

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 TableCell clone()
Returns a copy of this TableCell.

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


Copyright © 2009 Google. All Rights Reserved.