|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.visualization.datasource.datatable.value.Value
com.google.visualization.datasource.datatable.value.DateValue
public class DateValue
A value of type date. Used to represent a specific day in a given year. This differs from
DateTimeValue, which represents a specific day in a given year as well as a specific
time during that day.
Date is represented internally by three values: year, month and dayOfMonth.
This class stores only legitimate dates where the validation is done using
ibm.icu.GregorianCalendar.
| Constructor Summary | |
|---|---|
DateValue(com.ibm.icu.util.GregorianCalendar calendar)
Creates a new instance based on the given GregorianCalendar. |
|
DateValue(int year,
int month,
int dayOfMonth)
Creates a new date value. |
|
| Method Summary | |
|---|---|
int |
compareTo(Value other)
Compares this value to another value of the same type. |
int |
getDayOfMonth()
Returns the underlying dayOfMonth. |
int |
getMonth()
Returns the underlying month. |
static DateValue |
getNullValue()
Static method to return the null value (same one for all calls). |
com.ibm.icu.util.Calendar |
getObjectToFormat()
Uses an ibm.icu.text.UFormat instance to format Values. |
ValueType |
getType()
Returns the type of this cell. |
int |
getYear()
Returns the underlying year. |
int |
hashCode()
Returns the hashcode of this 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 value a logical null. |
java.lang.String |
toString()
Returns the dateValue as a String using temporary 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 |
| Constructor Detail |
|---|
public DateValue(int year,
int month,
int dayOfMonth)
year - The year.month - The month.dayOfMonth - The day in the month.
java.lang.IllegalArgumentException - Thrown when one of the
parameters is illegal.public DateValue(com.ibm.icu.util.GregorianCalendar calendar)
GregorianCalendar.
The given calendar's time zone must be set to "GMT" as a precondition to
use this constructor.
Note: The date values: year, month, dayOfMonth correspond to the values
returned by calendar.get(field) of the given calendar.
calendar - A gregorian to extract this instance values: year, month
and dayOfMonth.
java.lang.IllegalArgumentException - When calendar time zone is not set
to GMT.| Method Detail |
|---|
public static DateValue getNullValue()
public ValueType getType()
Value
getType in class Valuepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isNull()
isNull in class Valuepublic int compareTo(Value other)
other - Other value.
public int hashCode()
Value
hashCode in class Valuepublic com.ibm.icu.util.Calendar getObjectToFormat()
Value
getObjectToFormat in class Valuepublic int getYear()
NullValueException - Thrown when this Value is NULL_VALUE.public int getMonth()
NullValueException - Thrown when this Value is NULL_VALUE.public int getDayOfMonth()
NullValueException - Thrown when this Value is NULL_VALUE.protected java.lang.String innerToQueryString()
innerToQueryString in class Value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||