com.google.visualization.datasource.datatable.value
Class TextValue

java.lang.Object
  extended by com.google.visualization.datasource.datatable.value.Value
      extended by com.google.visualization.datasource.datatable.value.TextValue
All Implemented Interfaces:
java.lang.Comparable<Value>

public class TextValue
extends Value

A value of type text (string).

Author:
Yoah B.D.

Constructor Summary
TextValue(java.lang.String value)
          Creates a new text cell.
 
Method Summary
 int compareTo(Value other)
          Compares this value to another value of the same type.
static TextValue getNullValue()
          Static method to return the null value (same one for all calls).
 java.lang.String getObjectToFormat()
          Uses an ibm.icu.text.UFormat instance to format Values.
static java.util.Comparator<TextValue> getTextLocalizedComparator(com.ibm.icu.util.ULocale ulocale)
          Returns a comparator that compares text values according to a given locale.
 ValueType getType()
          Returns the type of this cell.
 java.lang.String getValue()
          Returns the text value.
 int hashCode()
          Returns a hash code for this string value.
protected  java.lang.String innerToQueryString()
          Returns a string that, when parsed by the query parser, should return an identical value.
 boolean isNull()
          Tests whether this cell's value is logical null.
 java.lang.String toString()
          Returns the text.
 
Methods inherited from class com.google.visualization.datasource.datatable.value.Value
equals, getLocalizedComparator, getNullValueFromValueType, toQueryString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TextValue

public TextValue(java.lang.String value)
Creates a new text cell.

Parameters:
value - The cell's value.
Method Detail

getType

public ValueType getType()
Description copied from class: Value
Returns the type of this cell.

Specified by:
getType in class Value
Returns:
The type of this cell.

toString

public java.lang.String toString()
Returns the text.

Overrides:
toString in class java.lang.Object
Returns:
The underlying text.

getNullValue

public static TextValue getNullValue()
Static method to return the null value (same one for all calls).

Returns:
Null value.

isNull

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

Specified by:
isNull in class Value
Returns:
Indication of whether the cell's value is null.

compareTo

public int compareTo(Value other)
Compares this value to another value of the same type.

Parameters:
other - Other value.
Returns:
0 if equal, negative if this is smaller, positive if larger.

hashCode

public int hashCode()
Returns a hash code for this string value.

Specified by:
hashCode in class Value
Returns:
A hash code for this string value.

getObjectToFormat

public java.lang.String getObjectToFormat()
Description copied from class: Value
Uses an ibm.icu.text.UFormat instance to format Values. The following method returns an object representing this Value that a UFormat can format.

Specified by:
getObjectToFormat in class Value
Returns:
An object representing this value that can be formatted by a UFormat formatter, null for a NULL_VALUE.

getTextLocalizedComparator

public static java.util.Comparator<TextValue> getTextLocalizedComparator(com.ibm.icu.util.ULocale ulocale)
Returns a comparator that compares text values according to a given locale.

Parameters:
ulocale - The ulocale defining the order relation for text values.
Returns:
A comparator that compares text values according to a given locale.

getValue

public java.lang.String getValue()
Returns the text value.

Returns:
The underlying text value.

innerToQueryString

protected java.lang.String innerToQueryString()
Returns a string that, when parsed by the query parser, should return an identical value. Assumes this value is not null.

Specified by:
innerToQueryString in class Value
Returns:
A string form of this value.


Copyright © 2009 Google. All Rights Reserved.