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

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

public class BooleanValue
extends Value

A value of type boolean. Valid values are TRUE, FALSE and NULL_VALUE.

Author:
Yoah B.D.

Field Summary
static BooleanValue FALSE
          A single static FALSE value.
static BooleanValue TRUE
          A single static TRUE value.
 
Method Summary
 int compareTo(Value other)
          Compares this cell to another cell of the same type.
static BooleanValue getInstance(java.lang.Boolean value)
          Static method to return a BooleanValue based on a given java boolean.
static BooleanValue getNullValue()
          Static method to return the null value (same one for all calls)
 java.lang.Boolean getObjectToFormat()
          Uses an ibm.icu.text.UFormat instance to format Values.
 ValueType getType()
          Returns the type of this cell.
 boolean getValue()
          Returns the underlying value.
 int hashCode()
          Returns a hash code for this boolean 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 a logical null.
 java.lang.String toString()
          Returns the value with default formatting.
 
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
 

Field Detail

TRUE

public static final BooleanValue TRUE
A single static TRUE value.


FALSE

public static final BooleanValue FALSE
A single static FALSE value.

Method Detail

getNullValue

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

Returns:
Null value.

getInstance

public static BooleanValue getInstance(java.lang.Boolean value)
Static method to return a BooleanValue based on a given java boolean. If the parameter is null, returns NULL_VALUE.

Parameters:
value - The java Boolean value to be represented.
Returns:
The static predefined instance of the given value.

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.

getValue

public boolean getValue()
Returns the underlying value.

Returns:
The underlying value.

toString

public java.lang.String toString()
Returns the value with default formatting.

Overrides:
toString in class java.lang.Object
Returns:
The value with default formatting.

isNull

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

Specified by:
isNull in class Value
Returns:
Indication if the call's value is null.

compareTo

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

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

hashCode

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

Specified by:
hashCode in class Value
Returns:
A hash code for this boolean value. Null gets -1, false gets 0, true gets 1.

getObjectToFormat

public java.lang.Boolean 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.

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.