|
© 2003 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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
.
Field Summary |
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,
TimeZone timeZone)
Constructs a new Date for the given year, month, date and timezone. |
Method Summary | |
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(Object anotherObject)
Compares this Date with another object. |
static Date |
createDate()
Returns a Date instance for today. |
static Date |
createDate(Date date)
Given a java.util.Date, returns a Date instance. |
static Date |
createDate(long year,
int month,
int day,
TimeZone timeZone)
Given the given year, month, date and timezone, returns a Date instance. |
static Date |
createDate(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 |
Date |
toSQLDate()
Returns a java.sql.Date equivalent. |
String |
toString()
Returns a XML schema compliant date string. |
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, TimeZone timeZone)
year
- the year (CCYY) fieldmonth
- the month (MM) fieldday
- the day (DD) fieldMethod Detail |
public static Date createDate()
public static Date createDate(String date) throws ParseException
ParseException
- thrown due to illegal
string argument.public static Date createDate(Date date)
date
- date
public static Date createDate(long year, int month, int day, TimeZone timeZone)
year
- the year (CCYY) fieldmonth
- the month (MM) fieldday
- the day (DD) field
public int getDay()
public void setDay(int day) throws IllegalArgumentException
day
- the day (DD)
IllegalArgumentException
- thrown when the day
argument is illegalpublic Object toUTC()
toUTC
in class Month
public Object clone()
clone
in class Month
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.
IllegalArgumentException
- thrown when the argument
is represented in a different time zone.public int compareTo(Object anotherObject)
compareTo
in interface Comparable
compareTo
in class Month
ClassCastException
- thrown if the argument is not an
instance of Date.public String toString()
Returns a XML schema compliant date string.
toString
in class Month
public Date toSQLDate()
Returns a java.sql.Date
equivalent. Note that
this operation excludes any timezone.
|
© 2003 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |