Class RecurringDuration
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
TimeInstant,TimePeriod
(+|-)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/
- Version:
- $Revision: 7294 $
- Author:
- Arnaud Blandin
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.RecurringDuration(String duration, String period) Deprecated.returns a recurringDuration with the facets duration and period set upRecurringDuration(String duration, String period, short[] values) Deprecated.returns a recurringDuration with the facets duration and period set up but also the fieldsRecurringDuration(TimeDuration duration, TimeDuration period) Deprecated.returns a recurringDuration with the facets duration and period set up -
Method Summary
Modifier and TypeMethodDescriptionbooleanequal(RecurringDuration reccD) Deprecated.Returns true if the present instance of Recurring Duration is equal to the parameter.booleanDeprecated.Override the java.lang.equals methodshortDeprecated.shortgetDay()Deprecated.shortgetMonth()Deprecated.short[]Deprecated.returns an array of short with all the fields which describe a RecurringDurationshortgetYear()Deprecated.booleanisGreater(RecurringDuration reccD) Deprecated.Returns true if the present instance of RecurringDuration is greater than the parameterbooleanisLeap()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 100static ObjectDeprecated.static RecurringDurationDeprecated.Parse a String and convert it into a recurringDuration.voidsetCentury(short century) Deprecated.set the century fieldvoidsetDay(short day) Deprecated.set the Day FieldvoidsetMonth(short month) Deprecated.set the Month FieldvoidsetValues(short[] values) Deprecated.set all the fields by reading the values in an arrayvoidsetYear(short year) Deprecated.set the Year field Note: 0000 is not allowedtoDate()Deprecated.convert this recurringDuration into a local DatetoString()Deprecated.Convert this recurringDuration to a stringMethods inherited from class org.exolab.castor.types.RecurringDurationBase
equal, getDuration, getHour, getMilli, getMinute, getPeriod, getSeconds, getZoneHour, getZoneMinute, isGreater, isNegative, isUTC, isZoneNegative, setDuration, setDuration, setHour, setMinute, setNegative, setPeriod, setPeriod, setSecond, setUTC, setZone, setZoneNegative
-
Constructor Details
-
RecurringDuration
public RecurringDuration()Deprecated. -
RecurringDuration
Deprecated.returns a recurringDuration with the facets duration and period set up- Parameters:
duration- the TimeDuration representing the duration facetperiod- the TimeDuration reprensenting the period facet
-
RecurringDuration
Deprecated.returns a recurringDuration with the facets duration and period set up- Parameters:
duration- the String representing the duration facetperiod- the String reprensenting the period facet
-
RecurringDuration
public RecurringDuration(String duration, String period, short[] values) throws UnsupportedOperationException Deprecated.returns a recurringDuration with the facets duration and period set up but also the fields- Parameters:
duration- the String representing the duration facetperiod- the String reprensenting the period facetvalues- an array of shorts which contains the values of the fields- Throws:
UnsupportedOperationException- See Also:
-
-
Method Details
-
setCentury
public void setCentury(short century) Deprecated.set the century field- Parameters:
century- the value to set up
-
setYear
Deprecated.set the Year field Note: 0000 is not allowed- Parameters:
year- year to set up- Throws:
UnsupportedOperationException
-
setMonth
Deprecated.set the Month Field- Parameters:
month- the value to set up Note 1invalid input: '<'monthinvalid input: '<'12- Throws:
UnsupportedOperationException
-
setDay
Deprecated.set the Day Field- Parameters:
day- the value to set up Note a validation is done on the day field- Throws:
UnsupportedOperationException
-
isLeap
public 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- Returns:
- true if the year field represents a leap year
-
setValues
Deprecated.set all the fields by reading the values in an array- Overrides:
setValuesin classRecurringDurationBase- Parameters:
values- an array of shorts with the values the array is supposed to be of length 10 and ordered like that:- century
- year
- month
- day
- hour
- minute
- second
- millisecond
- zoneHour
- zoneMinute
- Throws:
UnsupportedOperationException- this exception is thrown if changing the value of one field os not allowed- See Also:
-
getCentury
public short getCentury()Deprecated. -
getYear
public short getYear()Deprecated. -
getMonth
public short getMonth()Deprecated. -
getDay
public short getDay()Deprecated. -
getValues
public short[] getValues()Deprecated.returns an array of short with all the fields which describe a RecurringDuration- Overrides:
getValuesin classRecurringDurationBase- Returns:
- an array of short with all the fields which describe a RecurringDuration
-
toDate
Deprecated.convert this recurringDuration into a local DateNote : 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
- Returns:
- a local date representing this recurringDuration
- Throws:
ParseException
-
toString
Deprecated.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)
-
parse
Deprecated.- Throws:
ParseException
-
parseRecurringDuration
Deprecated.Parse a String and convert it into a recurringDuration.- Parameters:
str- The string to parse.- Returns:
- The recurringDuration represented by the string.
- Throws:
ParseException- A parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class).
-
equals
Deprecated.Override the java.lang.equals method- Overrides:
equalsin classRecurringDurationBase- See Also:
-
equal
Deprecated.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
- Parameters:
reccD- the recurring duration to compare with the present instance- Returns:
- true if the present instance is equal to the parameter false if not
- Throws:
ValidationException
-
isGreater
Deprecated.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 invalid input: '<' rd2 iff rd2-rd1>0
- Parameters:
reccD- the recurring duration to compare with the present instance- Returns:
- true if the present instance is the greatest, false if not
- Throws:
ValidationException
-