|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.p13n.xml.schema.Century | +--com.bea.p13n.xml.schema.Year | +--com.bea.p13n.xml.schema.Month | +--com.bea.p13n.xml.schema.Date
This class provides the Java biding for the XML schema type date as specified in Section 3.3.27 of XML Schema Part 2: Datatypes.
date represents a specific period of time that starts at midnight and lasts until the mignight the following day.
The value space of month is the set of Gregorian calendar dates specified as CCYY-MM-DD.
Example: 2001-01-01
.
Fields inherited from class com.bea.p13n.xml.schema.Century |
_internal |
Constructor Summary | |
protected |
Date()
Constructs a new Date instance. |
protected |
Date(long year,
int month,
int day,
java.util.TimeZone timeZone)
Constructs a new Date for the given year, month, date and timezone. |
Method Summary | |
java.lang.Object |
clone()
Returns a copy of this date. |
int |
compareTo(Date anotherDate)
Compares this Date to another Date object (represented in the same time zone) in their canonical representation. |
int |
compareTo(java.lang.Object anotherObject)
Compares this Date with another object. |
static Date |
createDate()
Returns a Date instance for today. |
static Date |
createDate(java.util.Date date)
Given a java.util.Date, returns a Date instance. |
static Date |
createDate(long year,
int month,
int day,
java.util.TimeZone timeZone)
Given the given year, month, date and timezone, returns a Date instance. |
static Date |
createDate(java.lang.String date)
Given a string of the form CCYY-MM-DD, returns a Date instance. |
int |
getDay()
Returns the day (DD) field |
void |
setDay(int day)
Sets the month (DD) field |
java.sql.Date |
toSQLDate()
Returns a java.sql.Date equivalent. |
java.lang.String |
toString()
Returns a XML schema compliant date string. |
java.lang.Object |
toUTC()
Offsets the current date instant to UTC. |
Methods inherited from class com.bea.p13n.xml.schema.Month |
compareTo,
createMonth,
createMonth,
getMonth,
setMonth |
Methods inherited from class com.bea.p13n.xml.schema.Year |
compareTo,
createYear,
createYear,
getYear,
setYear,
setYear |
Methods inherited from class com.bea.p13n.xml.schema.Century |
compareTo,
createCentury,
createCentury,
getCentury,
getEra,
getTimeZone,
setCentury,
setEra,
setTimeZone,
setTimeZone |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
protected Date()
protected Date(long year, int month, int day, java.util.TimeZone timeZone)
year
- the year (CCYY) fieldmonth
- the month (MM) fieldday
- the day (DD) fieldtimezone
- the timezone. May be null if local.Method Detail |
public static Date createDate()
public static Date createDate(java.lang.String date) throws java.text.ParseException
public static Date createDate(java.util.Date date)
date
- datepublic static Date createDate(long year, int month, int day, java.util.TimeZone timeZone)
year
- the year (CCYY) fieldmonth
- the month (MM) fieldday
- the day (DD) fieldtimezone
- the timezone. May be null if local.public int getDay()
public void setDay(int day) throws java.lang.IllegalArgumentException
day
- the day (DD)public java.lang.Object toUTC()
public java.lang.Object clone()
public int compareTo(Date anotherDate)
Compares this Date to another Date object (represented in the same time zone) in their canonical representation.
anotherDate
- another Date object to be compared.public int compareTo(java.lang.Object anotherObject)
object
- the object to be comparedpublic java.lang.String toString()
Returns a XML schema compliant date string.
public java.sql.Date toSQLDate()
Returns a java.sql.Date
equivalent. Note that
this operation excludes any timezone.
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |