|
© 2005 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
This class provides the Java biding for the XML schema type month as specified in Section 3.3.28 of XML Schema Part 2: Datatypes.
month represents a specific period of time that starts on the first day of the month and lasts until the midnight that ends the last day of the month.
The value space of month is the set of Gregorian calendar months specified as CCYY-MM. It is a set of one-month long, non-period instances independent of how many days this month has.
Example: 2001-01
.
Field Summary |
Fields inherited from class com.bea.p13n.xml.schema.Century |
_internal |
Constructor Summary | |
protected |
Month()
Constructs a new Month instance. |
protected |
Month(long year,
int month,
TimeZone timeZone)
Constructs a new Month for the given year, month and timezone. |
Method Summary | |
Object |
clone()
Returns a copy of this Month. |
int |
compareTo(Month anotherMonth)
Compares this Month to another Month object (represented in the same time zone) in their canonical representation. |
int |
compareTo(Object anotherObject)
Compares this TimePeriod with another object. |
static Month |
createMonth()
Returns a Month instance for the current month. |
static Month |
createMonth(String month)
Given a string of the form CCYY-MM, returns a Month instance. |
int |
getMonth()
Returns the month (MM) field |
void |
setMonth(int month)
Sets the month (MM) field |
String |
toString()
Returns a XML schema compliant date string. |
Object |
toUTC()
Offsets the current month instant to UTC. |
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 Month()
protected Month(long year, int month, TimeZone timeZone)
Method Detail |
public Object clone()
clone
in class Year
public int compareTo(Month anotherMonth)
Compares this Month to another Month object (represented in the same time zone) in their canonical representation.
anotherMonth
- another Month object to be compared.
IllegalArgumentException
- thrown when the argument is
represented in a different time zone from the current month.public int compareTo(Object anotherObject)
compareTo
in interface Comparable
compareTo
in class Year
ClassCastException
- thrown if the argument is not an
instance of TimePeriod.public static Month createMonth()
public static Month createMonth(String month) throws ParseException
Given a string of the form CCYY-MM, returns a Month instance.
The argument may optionally include a timezone.
ParseException
- thrown due to illegal
string argument.public int getMonth()
public void setMonth(int month) throws IllegalArgumentException
month
- the month (MM)
IllegalArgumentException
- thrown when the month
argument is illegalpublic String toString()
Returns a XML schema compliant date string.
toString
in class Year
public Object toUTC()
toUTC
in class Year
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |