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
RecurringDurationBase
protected RecurringDurationBase()
RecurringDurationBase
protected RecurringDurationBase(String duration,
String period)
throws IllegalArgumentException
returns a recurringDurationBase with the facets
duration and period set up
duration
- the String representing the duration facetperiod
- the String reprensenting the period facet
RecurringDurationBase
protected RecurringDurationBase(String duration,
String period,
short[] values)
throws OperationNotSupportedException
returns a recurringDurationBase with the facets
duration and period set up but also the fields
duration
- the String representing the duration facetperiod
- the String reprensenting the period facetvalues
- an array of shorts which contains the values of the fields
RecurringDurationBase
protected RecurringDurationBase(TimeDuration duration,
TimeDuration period)
returns a recurringDurationBase with the facets
duration and period set up
duration
- the TimeDuration representing the duration facetperiod
- the TimeDuration reprensenting the period facet
equal
public boolean equal(RecurringDurationBase reccD)
throws ValidationException
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
reccD
- the recurring duration to compare with the present instance
- true if the present instance is equal to the parameter false if not
equals
public boolean equals(Object object)
Override the java.lang.equals method
getHour
public short getHour()
getMilli
public short getMilli()
getMinute
public short getMinute()
getSeconds
public short getSeconds()
getValues
public short[] getValues()
returns an array of short with all the fields which describe
a RecurringDurationBase
- an array of short with all the fields which describe
a RecurringDurationBase
getZoneHour
public short getZoneHour()
getZoneMinute
public short getZoneMinute()
isGreater
public boolean isGreater(RecurringDurationBase reccD)
throws ValidationException
Returns true if the present instance of RecurringDurationBase is greater than
the parameter
Note : the order relation follows the W3C XML Schema draft i.e
rd1 <32rd2 iff rd2-rd1>0
reccD
- the recurring duration base to compare with the present instance
- true if the present instance is the greatest, false if not
isNegative
public boolean isNegative()
isUTC
public boolean isUTC()
return true if this recurring Duration type is UTC
i.e if there is no time zone.
isZoneNegative
public boolean isZoneNegative()
setDuration
public void setDuration(String duration)
throws OperationNotSupportedException
set the duration facet for this recurringDuration
duration
- the period to set
setMinute
public void setMinute(short minute)
throws OperationNotSupportedException
set the minute field for this recurringDuration
minute
- the minute to set
setNegative
public void setNegative()
set the negative field to true
setPeriod
public void setPeriod(String period)
throws OperationNotSupportedException
set the period facet for this recurringDuration
period
- the period to set
setSecond
public void setSecond(short second,
short millsecond)
throws OperationNotSupportedException
set the second field for this recurringDuration
second
- the second to setmillsecond
- the millisecond to set
setUTC
public void setUTC()
set the UTC field to true
setValues
public void setValues(short[] values)
throws OperationNotSupportedException
set all the fields by reading the values in an array
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
setZone
public void setZone(short hour,
short minute)
throws OperationNotSupportedException
set the time zone fields for this recurringDuration
hour
- the time zone hour to setminute
- the time zone minute to set