org.exolab.castor.types

Class Century

Implemented Interfaces:
java.io.Serializable

public class Century
extends TimePeriod

Describe an XML schema Century

The date type is derived from time period by setting up the facet:

Note: This datatype is not included in any recommendation. It was introduced in http://www.w3.org/TR/2000/WD-xmlschema-2-20000407/ and was last in http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/ and was removed by http://www.w3.org/TR/2001/PR-xmlschema-2-20010316/. It was not in the final approved recommendation: http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/

Version:
$Revision: 7289 $
Author:
Arnaud Blandin
See Also:
Serialized Form

Constructor Summary

Century()

Method Summary

static Object
parse(String str)
parse a String and convert it into a java.lang.Object
static Century
parseCentury(String str)
parse a String and convert it into a Century
void
setDay(short day)
set the Day Field
void
setHour(short hour)
void
setMinute(short minute)
void
setMonth(short month)
set the Month Field
void
setSecond(short second, short millsecond)
void
setYear(short year)
set the Year field Note: 0000 is not allowed
void
setZone(short hour, short minute)
void
setZoneNegative()
java.util.Date
toDate()
convert this recurringDuration into a local Date

Note : Be aware a the 'local' property of the date i.e toDate() will de the conversion between a UTC date and your computer date format.

String
toString()
convert this Year to a string The format is defined by W3C XML Schema draft and ISO8601 i.e (+|-)CC

Methods inherited from class org.exolab.castor.types.TimePeriod

setFields, setPeriod

Methods inherited from class org.exolab.castor.types.RecurringDuration

equal, equals, getCentury, getDay, getMonth, getValues, getYear, isGreater, isLeap, parse, parseRecurringDuration, setCentury, setDay, setMonth, setValues, setYear, toDate, toString

Methods inherited from class org.exolab.castor.types.RecurringDurationBase

equal, equals, getDuration, getHour, getMilli, getMinute, getPeriod, getSeconds, getValues, getZoneHour, getZoneMinute, isGreater, isNegative, isUTC, isZoneNegative, setDuration, setDuration, setHour, setMinute, setNegative, setPeriod, setPeriod, setSecond, setUTC, setValues, setZone, setZoneNegative

Constructor Details

Century

public Century()

Method Details

parse

public static Object parse(String str)
            throws ParseException
parse a String and convert it into a java.lang.Object
Overrides:
parse in interface RecurringDuration
Parameters:
str - the string to parse
Returns:
the java.lang.Object represented by the string

parseCentury

public static Century parseCentury(String str)
            throws ParseException
parse a String and convert it into a Century
Parameters:
str - the string to parse
Returns:
the Century represented by the string

setDay

public void setDay(short day)
            throws UnsupportedOperationException
set the Day Field
Overrides:
setDay in interface RecurringDuration
Parameters:
day - the value to set up Note a validation is done on the day field

setHour

public void setHour(short hour)
            throws UnsupportedOperationException
Overrides:
setHour in interface RecurringDurationBase

setMinute

public void setMinute(short minute)
            throws UnsupportedOperationException
Overrides:
setMinute in interface RecurringDurationBase

setMonth

public void setMonth(short month)
            throws UnsupportedOperationException
set the Month Field
Overrides:
setMonth in interface RecurringDuration
Parameters:
month - the value to set up Note 1<12>

setSecond

public void setSecond(short second,
                      short millsecond)
            throws UnsupportedOperationException
Overrides:
setSecond in interface RecurringDurationBase

setYear

public void setYear(short year)
            throws UnsupportedOperationException
set the Year field Note: 0000 is not allowed
Overrides:
setYear in interface RecurringDuration
Parameters:
year - year to set up

setZone

public void setZone(short hour,
                    short minute)
            throws UnsupportedOperationException
Overrides:
setZone in interface RecurringDurationBase

setZoneNegative

public void setZoneNegative()
            throws UnsupportedOperationException
Overrides:
setZoneNegative in interface RecurringDurationBase

toDate

public java.util.Date toDate()
            throws ParseException
convert this recurringDuration into a local Date

Note : Be aware a the 'local' property of the date i.e toDate() will de the conversion between a UTC date and your computer date format. For instance if you have set up your computer time zone on the Pacific Day Time the conversion of 2000-10-20T00:00:00.000 into a java.util.Date will return Thu Oct 19 17:00:00 PDT 2000

Overrides:
toDate in interface RecurringDuration
Returns:
a local date representing this recurringDuration

toString

public String toString()
convert this Year to a string The format is defined by W3C XML Schema draft and ISO8601 i.e (+|-)CC
Overrides:
toString in interface RecurringDuration
Returns:
a string representing this Century

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com