|
© 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
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.
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 century is the set of Gregorian calendar centuries specified as CC.
Example: 21
for 21st century
Field Summary | |
protected TimePeriod |
_internal
|
Constructor Summary | |
protected |
Century()
Constructs a new Century instance. |
protected |
Century(long century,
TimeZone timeZone)
Constructs a new Century for the given century and timezone. |
Method Summary | |
Object |
clone()
Returns a copy of this Century. |
int |
compareTo(Century anotherCentury)
Compares this Century to another Century object (represented in the same time zone) in their canonical representation. |
int |
compareTo(Object anotherObject)
Compares this Century another object. |
static Century |
createCentury()
Returns a Century instance for the current century. |
static Century |
createCentury(String century)
Given a string of the form CC, returns a Century instance. |
long |
getCentury()
Returns the year (CC) field |
int |
getEra()
Returns the era (+/-) |
TimeZone |
getTimeZone()
Returns the time zone |
void |
setCentury(long century)
Sets the year (CCYY) field |
void |
setEra(int era)
Sets the era (+/-) |
void |
setTimeZone(int zoneHour,
int zoneMinute)
Sets the time zone |
void |
setTimeZone(TimeZone timeZone)
Sets the time zone |
String |
toString()
Returns a XML schema compliant year string. |
Object |
toUTC()
Offsets the current century instant to UTC. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected TimePeriod _internal
Constructor Detail |
protected Century()
protected Century(long century, TimeZone timeZone)
Method Detail |
public Object clone()
public int compareTo(Century anotherCentury)
Compares this Century to another Century object (represented in the same time zone) in their canonical representation.
anotherCentury
- another Century object to be compared.
IllegalArgumentException
- thrown when the argument is
represented in a different time zone from the current year.public int compareTo(Object anotherObject)
compareTo
in interface Comparable
ClassCastException
- thrown if the argument is not an
instance of Year.public static Century createCentury()
public static Century createCentury(String century) throws ParseException
Given a string of the form CC, returns a Century instance.
The argument may optionally include a timezone.
ParseException
- thrown due to illegal
string argument.public long getCentury()
public int getEra()
public TimeZone getTimeZone()
public void setCentury(long century) throws IllegalArgumentException
century
- the century (CC)
IllegalArgumentException
- thrown when the century and
year arguments are illegalpublic void setEra(int era)
era
- the era (+/-)public void setTimeZone(int zoneHour, int zoneMinute)
zoneHour
- the hour field of timeZone. Can be negative to
indicate negative offset.zoneMinute
- the minute field of timeZonepublic void setTimeZone(TimeZone timeZone)
timeZone
- an instance java.util.TimeZonepublic String toString()
Returns a XML schema compliant year string.
public Object toUTC()
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |