Package org.exolab.castor.types
Class RecurringDurationBase
- java.lang.Object
-
- org.exolab.castor.types.RecurringDurationBase
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
RecurringDuration
public abstract class RecurringDurationBase extends java.lang.Object implements java.io.SerializableDeprecated.since Castor 1.0.6 since type derived from this base class are not in any recommendation.The base class for recurring Duration types.This base class contains all the time fields (including the time zone ones) and also the facets period and duration
The validation of the time fields is done in the set methods and follows the ISO8601 Date and Time Format
- Author:
- Arnaud Blandin
- See Also:
RecurringDuration,Time,TimeInstant,TimePeriod, Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRecurringDurationBase()Deprecated.No-arg constructor.protectedRecurringDurationBase(java.lang.String duration, java.lang.String period)Deprecated.returns a recurringDurationBase with the facets duration and period set upprotectedRecurringDurationBase(java.lang.String duration, java.lang.String period, short[] values)Deprecated.returns a recurringDurationBase with the facets duration and period set up but also the fieldsprotectedRecurringDurationBase(TimeDuration duration, TimeDuration period)Deprecated.Returns a recurringDurationBase with the facets duration and period set.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequal(RecurringDurationBase reccD)Deprecated.Returns true if the present instance of Recurring Duration Base is equal to the parameter.booleanequals(java.lang.Object object)Deprecated.Override the java.lang.equals methodTimeDurationgetDuration()Deprecated.shortgetHour()Deprecated.shortgetMilli()Deprecated.shortgetMinute()Deprecated.TimeDurationgetPeriod()Deprecated.shortgetSeconds()Deprecated.short[]getValues()Deprecated.returns an array of short with all the fields which describe a RecurringDurationBaseshortgetZoneHour()Deprecated.shortgetZoneMinute()Deprecated.booleanisGreater(RecurringDurationBase reccD)Deprecated.Returns true if the present instance of RecurringDurationBase is greater than the parameterbooleanisNegative()Deprecated.booleanisUTC()Deprecated.return true if this recurring Duration type is UTC i.e if there is no time zone.booleanisZoneNegative()Deprecated.voidsetDuration(java.lang.String duration)Deprecated.set the duration facet for this recurringDurationvoidsetDuration(TimeDuration duration)Deprecated.set the duration facet for this recurringDurationvoidsetHour(short hour)Deprecated.set the hour field for this recurringDurationvoidsetMinute(short minute)Deprecated.set the minute field for this recurringDurationvoidsetNegative()Deprecated.set the negative field to truevoidsetPeriod(java.lang.String period)Deprecated.set the period facet for this recurringDurationvoidsetPeriod(TimeDuration period)Deprecated.set the period facet for this recurringDurationvoidsetSecond(short second, short millsecond)Deprecated.set the second field for this recurringDurationvoidsetUTC()Deprecated.set the UTC field to truevoidsetValues(short[] values)Deprecated.set all the fields by reading the values in an arrayvoidsetZone(short hour, short minute)Deprecated.set the time zone fields for this recurringDurationvoidsetZoneNegative()Deprecated.set the time zone negative field to true
-
-
-
Constructor Detail
-
RecurringDurationBase
protected RecurringDurationBase()
Deprecated.No-arg constructor.
-
RecurringDurationBase
protected RecurringDurationBase(TimeDuration duration, TimeDuration period)
Deprecated.Returns a recurringDurationBase with the facets duration and period set.- Parameters:
duration- the TimeDuration representing the duration facetperiod- the TimeDuration reprensenting the period facet
-
RecurringDurationBase
protected RecurringDurationBase(java.lang.String duration, java.lang.String period) throws java.lang.IllegalArgumentExceptionDeprecated.returns a recurringDurationBase with the facets duration and period set up- Parameters:
duration- the String representing the duration facetperiod- the String reprensenting the period facet- Throws:
java.lang.IllegalArgumentException- this exception is thrown when the parameter strings are not corresponding to valid TimeDuration
-
RecurringDurationBase
protected RecurringDurationBase(java.lang.String duration, java.lang.String period, short[] values) throws javax.naming.OperationNotSupportedExceptionDeprecated.returns a recurringDurationBase 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:
java.lang.IllegalArgumentException- this exception is thrown when the values array is not of length 6.javax.naming.OperationNotSupportedException- See Also:
setValues(short[])
-
-
Method Detail
-
setPeriod
public void setPeriod(TimeDuration period) throws java.lang.UnsupportedOperationException
Deprecated.set the period facet for this recurringDuration- Parameters:
period- the period to set- Throws:
javax.naming.OperationNotSupportedException- this exception is thrown when changing the value of the period facet is not allowedjava.lang.UnsupportedOperationException
-
setPeriod
public void setPeriod(java.lang.String period) throws java.lang.UnsupportedOperationExceptionDeprecated.set the period facet for this recurringDuration- Parameters:
period- the period to set- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of the period facet is not allowed
-
setDuration
public void setDuration(TimeDuration duration) throws java.lang.UnsupportedOperationException
Deprecated.set the duration facet for this recurringDuration- Parameters:
duration- the period to set- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of the duration facet is not allowed
-
setDuration
public void setDuration(java.lang.String duration) throws java.lang.UnsupportedOperationExceptionDeprecated.set the duration facet for this recurringDuration- Parameters:
duration- the period to set- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of the duration facet is not allowed
-
setHour
public void setHour(short hour) throws java.lang.UnsupportedOperationExceptionDeprecated.set the hour field for this recurringDuration- Parameters:
hour- the hour to set- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of the hour field is not allowed
-
setMinute
public void setMinute(short minute) throws java.lang.UnsupportedOperationExceptionDeprecated.set the minute field for this recurringDuration- Parameters:
minute- the minute to set- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of the minute field is not allowed
-
setSecond
public void setSecond(short second, short millsecond) throws java.lang.UnsupportedOperationExceptionDeprecated.set the second field for this recurringDuration- Parameters:
second- the second to setmillsecond- the millisecond to set- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of the second field is not allowed
-
setZone
public void setZone(short hour, short minute) throws java.lang.UnsupportedOperationExceptionDeprecated.set the time zone fields for this recurringDuration- Parameters:
hour- the time zone hour to setminute- the time zone minute to set- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of the time zone fields is not allowed
-
setValues
public void setValues(short[] values) throws java.lang.UnsupportedOperationExceptionDeprecated.set all the fields by reading the values in an array- Parameters:
values- an array of shorts with the values the array is supposed to be of length 6 and ordered like that:- hour
- minute
- second
- millisecond
- zoneHour
- zoneMinute
- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the value of a time related field is not allowed
-
setNegative
public void setNegative()
Deprecated.set the negative field to true
-
setZoneNegative
public void setZoneNegative() throws java.lang.UnsupportedOperationExceptionDeprecated.set the time zone negative field to true- Throws:
java.lang.UnsupportedOperationException- this exception is thrown when changing the time zone fields is not allowed
-
setUTC
public void setUTC()
Deprecated.set the UTC field to true
-
getPeriod
public TimeDuration getPeriod()
Deprecated.
-
getDuration
public TimeDuration getDuration()
Deprecated.
-
getHour
public short getHour()
Deprecated.
-
getMinute
public short getMinute()
Deprecated.
-
getSeconds
public short getSeconds()
Deprecated.
-
getMilli
public short getMilli()
Deprecated.
-
getZoneHour
public short getZoneHour()
Deprecated.
-
getZoneMinute
public short getZoneMinute()
Deprecated.
-
getValues
public short[] getValues()
Deprecated.returns an array of short with all the fields which describe a RecurringDurationBase- Returns:
- an array of short with all the fields which describe a RecurringDurationBase
-
isUTC
public boolean isUTC()
Deprecated.return true if this recurring Duration type is UTC i.e if there is no time zone.- Returns:
- true if this recurringDuration type is UTC else false.
-
isNegative
public boolean isNegative()
Deprecated.
-
isZoneNegative
public boolean isZoneNegative()
Deprecated.
-
equals
public boolean equals(java.lang.Object object)
Deprecated.Override the java.lang.equals method- Overrides:
equalsin classjava.lang.Object- See Also:
equal(org.exolab.castor.types.RecurringDurationBase)
-
equal
public boolean equal(RecurringDurationBase reccD) throws ValidationException
Deprecated.Returns true if the present instance of Recurring Duration Base 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
public boolean isGreater(RecurringDurationBase reccD) throws ValidationException
Deprecated.Returns true if the present instance of RecurringDurationBase is greater than the parameterNote : the order relation follows the W3C XML Schema draft i.e rd1 < rd2 iff rd2-rd1>0
- Parameters:
reccD- the recurring duration base to compare with the present instance- Returns:
- true if the present instance is the greatest, false if not
- Throws:
ValidationException
-
-