Public Member Functions | Static Public Member Functions

org.exolab.castor.types.RecurringDuration Class Reference

Inheritance diagram for org.exolab.castor.types.RecurringDuration:
org.exolab.castor.types.RecurringDurationBase org.exolab.castor.types.TimeInstant org.exolab.castor.types.TimePeriod org.exolab.castor.types.Century org.exolab.castor.types.Month org.exolab.castor.types.Year

List of all members.

Public Member Functions

 RecurringDuration ()
 RecurringDuration (TimeDuration duration, TimeDuration period)
 RecurringDuration (String duration, String period)
 RecurringDuration (String duration, String period, short[] values) throws OperationNotSupportedException
void setCentury (short century)
void setYear (short year) throws OperationNotSupportedException
void setMonth (short month) throws OperationNotSupportedException
void setDay (short day) throws OperationNotSupportedException
boolean isLeap ()
void setValues (short[] values) throws OperationNotSupportedException
short getCentury ()
short getYear ()
short getMonth ()
short getDay ()
short[] getValues ()
Date toDate () throws ParseException
String toString ()
boolean equals (Object object)
boolean equal (RecurringDuration reccD) throws ValidationException
boolean isGreater (RecurringDuration reccD) throws ValidationException

Static Public Member Functions

static Object parse (String str) throws ParseException
static RecurringDuration parseRecurringDuration (String str) throws ParseException

Detailed Description

Represents recurringDuration utterly a recurringDuration must contain all the fields :

(+|-)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 '-'.

Author:
Arnaud Blandin
Version:
Revision:
1.1.1.1

Constructor & Destructor Documentation

org.exolab.castor.types.RecurringDuration.RecurringDuration (  ) 
org.exolab.castor.types.RecurringDuration.RecurringDuration ( TimeDuration  duration,
TimeDuration  period 
)

returns a recurringDuration with the facets duration and period set up

Parameters:
duration the TimeDuration representing the duration facet
period the TimeDuration reprensenting the period facet
Returns:
a recurringDuration with the facets duration and period set up
org.exolab.castor.types.RecurringDuration.RecurringDuration ( String  duration,
String  period 
)

returns a recurringDuration with the facets duration and period set up

Parameters:
duration the String representing the duration facet
period the String reprensenting the period facet
Returns:
a recurringDuration with the facets duration and period set up
org.exolab.castor.types.RecurringDuration.RecurringDuration ( String  duration,
String  period,
short[]  values 
) throws OperationNotSupportedException

returns a recurringDuration with the facets duration and period set up but also the fields

Parameters:
duration the String representing the duration facet
period the String reprensenting the period facet
values an array of shorts which contains the values of the fields
Returns:
a recurringDuration with the facets duration and period set up
See also:
setValues

References org.exolab.castor.types.RecurringDuration.setValues().


Member Function Documentation

boolean org.exolab.castor.types.RecurringDuration.equals ( Object  object  ) 
boolean org.exolab.castor.types.RecurringDuration.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

Parameters:
reccD the recurring duration to compare with the present instance
Returns:
true if the present instance is the greatest, false if not

References org.exolab.castor.types.TimeDuration.equals(), org.exolab.castor.types.RecurringDuration.equals(), org.exolab.castor.types.RecurringDurationBase.getDuration(), org.exolab.castor.types.RecurringDurationBase.getPeriod(), and org.exolab.castor.types.RecurringDuration.getValues().

boolean org.exolab.castor.types.RecurringDuration.isLeap (  ) 

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

Referenced by org.exolab.castor.types.RecurringDuration.setDay().

static Object org.exolab.castor.types.RecurringDuration.parse ( String  str  )  throws ParseException [static]
void org.exolab.castor.types.RecurringDuration.setValues ( short[]  values  )  throws OperationNotSupportedException

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 10 and ordered like that:

  • century
  • year
  • month
  • day
  • hour
  • minute
  • second
  • millisecond
  • zoneHour
  • zoneMinute
Exceptions:
OperationNotSupportedException this exception is thrown if changing the value of one field os not allowed
See also:
RecurringDurationBase.setValues

Reimplemented from org.exolab.castor.types.RecurringDurationBase.

References org.exolab.castor.types.RecurringDuration.setCentury(), org.exolab.castor.types.RecurringDuration.setDay(), org.exolab.castor.types.RecurringDurationBase.setHour(), org.exolab.castor.types.RecurringDurationBase.setMinute(), org.exolab.castor.types.RecurringDuration.setMonth(), org.exolab.castor.types.RecurringDurationBase.setSecond(), org.exolab.castor.types.RecurringDuration.setYear(), and org.exolab.castor.types.RecurringDurationBase.setZone().

Referenced by org.exolab.castor.types.RecurringDuration.RecurringDuration().

Date org.exolab.castor.types.RecurringDuration.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

Returns:
a local date representing this recurringDuration
Exceptions:
ParseException 

Reimplemented in org.exolab.castor.types.Century, org.exolab.castor.types.Month, and org.exolab.castor.types.Year.

References org.exolab.castor.types.RecurringDurationBase.getZoneHour(), org.exolab.castor.types.RecurringDurationBase.getZoneMinute(), org.exolab.castor.types.RecurringDurationBase.isUTC(), org.exolab.castor.types.RecurringDurationBase.isZoneNegative(), and org.exolab.castor.types.Date.parse().

String org.exolab.castor.types.RecurringDuration.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)

Returns:
a string representing this recurringDuration

Reimplemented in org.exolab.castor.types.Century, org.exolab.castor.types.Month, and org.exolab.castor.types.Year.

Referenced by org.exolab.castor.types.TimePeriodDescriptor.TimePeriodFieldHandler.getValue(), and org.exolab.castor.types.RecurringDurationDescriptor.RecurringDurationFieldHandler.getValue().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties