|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents an XML Schema-compatible Gregorian date.
Both the immutable GDate and the mutable GDateBuilder are GDateSpecifications. Use this interface where you want to allow callers to pass any implementation of a GDate.
GDate
,
XmlCalendar
Field Summary | |
static int |
HAS_DAY
Day of month is specified. |
static int |
HAS_MONTH
Month of year is specified. |
static int |
HAS_TIME
Time of day is specified. |
static int |
HAS_TIMEZONE
Timezone is specified. |
static int |
HAS_YEAR
Year is specified. |
Method Summary | |
String |
canonicalString()
The canonical string representation. |
int |
compareToGDate(GDateSpecification gdatespec)
Comparison to another GDate. |
int |
getBuiltinTypeCode()
Returns the builtin type code for the shape of the information contained in this instance, or 0 if the instance doesn't contain information corresponding to a Schema type. |
XmlCalendar |
getCalendar()
Retrieves the value of the current time as an XmlCalendar . |
Date |
getDate()
Retrieves the value of the current time as a java.util.Date instance. |
int |
getDay()
Gets the day-of-month. |
int |
getFlags()
Returns a combination of flags indicating the information contained by this GDate. |
BigDecimal |
getFraction()
Gets the fraction-of-second. |
int |
getHour()
Gets the hour-of-day. |
int |
getJulianDate()
Returns the Julian date corresponding to this Gregorian date. |
int |
getMillisecond()
Gets the rounded millisecond value. |
int |
getMinute()
Gets the minute-of-hour. |
int |
getMonth()
Gets the month-of-year. |
int |
getSecond()
Gets the second-of-minute. |
int |
getTimeZoneHour()
Gets the time zone hour. |
int |
getTimeZoneMinute()
Gets the time zone minutes. |
int |
getTimeZoneSign()
Gets the time zone sign. |
int |
getYear()
Gets the year. |
boolean |
hasDate()
True if this date/time specification specifies a full date (year, month, day) |
boolean |
hasDay()
True if this date/time specification specifies a day-of-month. |
boolean |
hasMonth()
True if this date/time specification specifies a month-of-year. |
boolean |
hasTime()
True if this date/time specification specifies a time-of-day. |
boolean |
hasTimeZone()
True if this date/time specification specifies a timezone. |
boolean |
hasYear()
True if this date/time specification specifies a year. |
boolean |
isImmutable()
True if this GDate specification is immutable. |
boolean |
isValid()
True if this GDate corresponds to a valid gregorian date value in XML schema. |
String |
toString()
The natural string representation. |
Field Detail |
public static final int HAS_TIMEZONE
getFlags()
.
public static final int HAS_YEAR
getFlags()
.
public static final int HAS_MONTH
getFlags()
.
public static final int HAS_DAY
getFlags()
.
public static final int HAS_TIME
getFlags()
.
Method Detail |
public int getFlags()
HAS_TIMEZONE
, HAS_YEAR
, HAS_MONTH
,
HAS_DAY
, and HAS_TIME
.
public boolean isImmutable()
public boolean isValid()
public boolean hasTimeZone()
public boolean hasYear()
public boolean hasMonth()
public boolean hasDay()
public boolean hasTime()
public boolean hasDate()
public int getYear()
public int getMonth()
public int getDay()
public int getHour()
public int getMinute()
public int getSecond()
public int getTimeZoneSign()
public int getTimeZoneHour()
public int getTimeZoneMinute()
public BigDecimal getFraction()
public int getMillisecond()
public int getJulianDate()
public XmlCalendar getCalendar()
XmlCalendar
.
XmlCalendar
is a subclass of GregorianCalendar
which is slightly customized to match XML schema date rules.
The returned XmlCalendar
has only those time and date fields
set that are reflected in the GDate object. Because of the way the
Calendar
contract works, any information in the isSet() vanishes
as soon as you view any unset field using get() methods.
This means that if it is important to understand which date fields
are set, you must call isSet() first before get().
public Date getDate()
public int compareToGDate(GDateSpecification gdatespec)
gdatespec
- the date to compare against.public int getBuiltinTypeCode()
Value will be equal to
SchemaType.BTC_NOT_BUILTIN
,
SchemaType.BTC_G_YEAR
,
SchemaType.BTC_G_YEAR_MONTH
,
SchemaType.BTC_G_MONTH
,
SchemaType.BTC_G_MONTH_DAY
,
SchemaType.BTC_G_DAY
,
SchemaType.BTC_DATE
,
SchemaType.BTC_DATE_TIME
, or
SchemaType.BTC_TIME
.
public String canonicalString()
public String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |