java.io.Serializable
TimeInstant
, TimePeriod
public class RecurringDuration extends RecurringDurationBase
(+|-)CCYY-MM-DDThh:mm:ss.sss(Z|(+|-)hh:mm)
The validation of the date fields is done in the set methods and follows the ISO8601 Date and Time Format
It is possible to omit higher components by using '-'.
Note: This datatype is not included in any recommendation. It was introduced in http://www.w3.org/TR/1999/WD-xmlschema-2-19990924/ 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/
Constructor | Description |
---|---|
RecurringDuration() |
Deprecated.
|
RecurringDuration(java.lang.String duration,
java.lang.String period) |
Deprecated.
returns a recurringDuration with the facets
duration and period set up
|
RecurringDuration(java.lang.String duration,
java.lang.String period,
short[] values) |
Deprecated.
returns a recurringDuration with the facets
duration and period set up but also the fields
|
RecurringDuration(TimeDuration duration,
TimeDuration period) |
Deprecated.
returns a recurringDuration with the facets
duration and period set up
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equal(RecurringDuration reccD) |
Deprecated.
Returns true if the present instance of Recurring Duration is equal to
the parameter.
|
boolean |
equals(java.lang.Object object) |
Deprecated.
Override the java.lang.equals method
|
short |
getCentury() |
Deprecated.
|
short |
getDay() |
Deprecated.
|
short |
getMonth() |
Deprecated.
|
short[] |
getValues() |
Deprecated.
returns an array of short with all the fields which describe
a RecurringDuration
|
short |
getYear() |
Deprecated.
|
boolean |
isGreater(RecurringDuration reccD) |
Deprecated.
Returns true if the present instance of RecurringDuration is greater than
the parameter
|
boolean |
isLeap() |
Deprecated.
return true if the year field represents a leap year
A specific year is a leap year if it is either evenly
divisible by 400 OR evenly divisible by 4 and not evenly divisible by 100
|
static java.lang.Object |
parse(java.lang.String str) |
Deprecated.
|
static RecurringDuration |
parseRecurringDuration(java.lang.String str) |
Deprecated.
Parse a String and convert it into a recurringDuration.
|
void |
setCentury(short century) |
Deprecated.
set the century field
|
void |
setDay(short day) |
Deprecated.
set the Day Field
|
void |
setMonth(short month) |
Deprecated.
set the Month Field
|
void |
setValues(short[] values) |
Deprecated.
set all the fields by reading the values in an array
|
void |
setYear(short year) |
Deprecated.
set the Year field
Note: 0000 is not allowed
|
java.util.Date |
toDate() |
Deprecated.
convert this recurringDuration into a local Date
|
java.lang.String |
toString() |
Deprecated.
Convert this recurringDuration to a string
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equal, getDuration, getHour, getMilli, getMinute, getPeriod, getSeconds, getZoneHour, getZoneMinute, isGreater, isNegative, isUTC, isZoneNegative, setDuration, setDuration, setHour, setMinute, setNegative, setPeriod, setPeriod, setSecond, setUTC, setZone, setZoneNegative
public RecurringDuration()
public RecurringDuration(TimeDuration duration, TimeDuration period)
duration
- the TimeDuration representing the duration facetperiod
- the TimeDuration reprensenting the period facetpublic RecurringDuration(java.lang.String duration, java.lang.String period)
duration
- the String representing the duration facetperiod
- the String reprensenting the period facetpublic RecurringDuration(java.lang.String duration, java.lang.String period, short[] values) throws java.lang.UnsupportedOperationException
duration
- the String representing the duration facetperiod
- the String reprensenting the period facetvalues
- an array of shorts which contains the values of the fieldsjava.lang.UnsupportedOperationException
setValues(short[])
public void setCentury(short century)
century
- the value to set uppublic void setYear(short year) throws java.lang.UnsupportedOperationException
year
- year to set upjava.lang.UnsupportedOperationException
public void setMonth(short month) throws java.lang.UnsupportedOperationException
month
- the value to set up
Note 1java.lang.UnsupportedOperationException
public void setDay(short day) throws java.lang.UnsupportedOperationException
day
- the value to set up
Note a validation is done on the day fieldjava.lang.UnsupportedOperationException
public boolean isLeap()
public void setValues(short[] values) throws java.lang.UnsupportedOperationException
setValues
in class RecurringDurationBase
values
- an array of shorts with the values
the array is supposed to be of length 10 and ordered like that:
java.lang.UnsupportedOperationException
- this exception is thrown if changing
the value of one field os not allowedRecurringDurationBase.setValues(short[])
public short getCentury()
public short getYear()
public short getMonth()
public short getDay()
public short[] getValues()
getValues
in class RecurringDurationBase
public java.util.Date toDate() throws java.text.ParseException
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
java.text.ParseException
public java.lang.String toString()
Convert this recurringDuration to a string
The format is defined by W3C XML Schema draft and ISO8601 i.e (+|-)CCYY-MM-DDThh:mm:ss.sss(Z|(+|-)hh:mm)
toString
in class java.lang.Object
public static java.lang.Object parse(java.lang.String str) throws java.text.ParseException
java.text.ParseException
public static RecurringDuration parseRecurringDuration(java.lang.String str) throws java.text.ParseException
str
- The string to parse.java.text.ParseException
- A parse exception is thrown if the string to parse
does not follow the rigth format (see the description of this class).public boolean equals(java.lang.Object object)
equals
in class RecurringDurationBase
equal(org.exolab.castor.types.RecurringDuration)
public boolean equal(RecurringDuration reccD) throws ValidationException
Returns true if the present instance of Recurring Duration is equal to the parameter.
The equals relation is the following :
rd1 equals rd2 iff each field of rd1 is equal to the corresponding field of rd2
reccD
- the recurring duration to compare with the present instanceValidationException
public boolean isGreater(RecurringDuration reccD) throws ValidationException
Returns true if the present instance of RecurringDuration is greater than the parameter
Note : the order relation follows the W3C XML Schema draft i.e rd1 < rd2 iff rd2-rd1>0
reccD
- the recurring duration to compare with the present instanceValidationException
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com