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