com.google.visualization.datasource.datatable.value
Enum ValueType

java.lang.Object
  extended by java.lang.Enum<ValueType>
      extended by com.google.visualization.datasource.datatable.value.ValueType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ValueType>

public enum ValueType
extends java.lang.Enum<ValueType>

Represents a supported value type for a table.

Author:
Yoah B.D.

Enum Constant Summary
BOOLEAN
           
DATE
           
DATETIME
           
NUMBER
           
TEXT
           
TIMEOFDAY
           
 
Method Summary
 Value createValue(java.lang.Object value)
          Creates a value of this ValueType.
 java.lang.String getTypeCodeLowerCase()
          Returns the type code string for this ValueType as a lower case string.
static ValueType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ValueType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

BOOLEAN

public static final ValueType BOOLEAN

NUMBER

public static final ValueType NUMBER

TEXT

public static final ValueType TEXT

DATE

public static final ValueType DATE

TIMEOFDAY

public static final ValueType TIMEOFDAY

DATETIME

public static final ValueType DATETIME
Method Detail

values

public static ValueType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ValueType c : ValueType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ValueType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getTypeCodeLowerCase

public java.lang.String getTypeCodeLowerCase()
Returns the type code string for this ValueType as a lower case string.

Returns:
The type code string for this ValueType as a lower case string.

createValue

public Value createValue(java.lang.Object value)
                  throws TypeMismatchException
Creates a value of this ValueType. The value must be of an appropriate class, otherwise an exception is thrown. Java native types/classes are translated to Value in the following way: String -> TextValue Number (inc. all derivatives such as Integer, Double) -> NumberValue Boolean -> BooleanValue com.ibm.icu.util.GregorianCalendar -> DateValue, DateTimeValue or TimeOfDayValue

Parameters:
value - The value to create.
Returns:
A Value of this ValueType.
Throws:
TypeMismatchException - When the type of value does not match this.


Copyright © 2009 Google. All Rights Reserved.