Public Member Functions | |
Duration () | |
Duration (String duration) throws ParseException | |
Duration (long l) | |
void | setYear (short year) |
void | setMonth (short month) |
void | setDay (short day) |
void | setHour (short hour) |
void | setMinute (short minute) |
void | setSeconds (short second) |
void | setMilli (long milli) |
void | setNegative () |
void | setValue (short year, short month, short day, short hour, short minute, short second, long millisecond) |
short | getYear () |
short | getMonth () |
short | getDay () |
short | getHour () |
short | getMinute () |
short | getSeconds () |
long | getMilli () |
boolean | isNegative () |
long | toLong () |
String | toString () |
int | hashCode () |
boolean | equals (Object object) |
boolean | equal (Duration duration) |
boolean | isGreater (Duration duration) |
Static Public Member Functions | |
static Object | parse (String str) throws ParseException |
static Duration | parseDuration (String str) throws ParseException |
This class is the representation of XML Schema datatype: duration.
This representation does not support the decimal fraction for the lowest order item.
The order relation provided by this implementation does not follow the guidelines of XML Schema Specification that defines only a partial order.
For more information see X3C XML Schema Specification.
org.exolab.castor.types.Duration.Duration | ( | ) |
default constructor
Referenced by org.exolab.castor.types.Duration.parseDuration().
org.exolab.castor.types.Duration.Duration | ( | String | duration | ) | throws ParseException |
Constructs a duration from a string
duration | the string representation of the duration to create |
org.exolab.castor.types.Duration.Duration | ( | long | l | ) |
This constructor fills in the duration fields according to the value of the long by calling setValue.
l | the long value of the Duration |
References org.exolab.castor.types.Duration.setNegative(), and org.exolab.castor.types.Duration.setValue().
boolean org.exolab.castor.types.Duration.equal | ( | Duration | duration | ) |
Returns true if the instance of TimeDuration has the same fields of the parameter
timeD | the time duration to compare |
References org.exolab.castor.types.Duration.getDay(), org.exolab.castor.types.Duration.getHour(), org.exolab.castor.types.Duration.getMilli(), org.exolab.castor.types.Duration.getMinute(), org.exolab.castor.types.Duration.getMonth(), org.exolab.castor.types.Duration.getSeconds(), org.exolab.castor.types.Duration.getYear(), and org.exolab.castor.types.Duration.isNegative().
Referenced by org.exolab.castor.types.Duration.equals().
boolean org.exolab.castor.types.Duration.equals | ( | Object | object | ) |
Override the java.lang.equals method
References org.exolab.castor.types.Duration.equal().
short org.exolab.castor.types.Duration.getDay | ( | ) |
short org.exolab.castor.types.Duration.getHour | ( | ) |
long org.exolab.castor.types.Duration.getMilli | ( | ) |
Referenced by org.exolab.castor.types.Duration.equal().
short org.exolab.castor.types.Duration.getMinute | ( | ) |
short org.exolab.castor.types.Duration.getMonth | ( | ) |
short org.exolab.castor.types.Duration.getSeconds | ( | ) |
short org.exolab.castor.types.Duration.getYear | ( | ) |
int org.exolab.castor.types.Duration.hashCode | ( | ) |
Overrides the java.lang.Object.hashcode method.
boolean org.exolab.castor.types.Duration.isGreater | ( | Duration | duration | ) |
Returns true if the present instance of TimeDuration is greater than the parameter
Note This definition does not follow the XML SCHEMA RECOMMENDATION 05022001 the following total order relation is used : givent t1,t2 timeDuration types t1>t2 iff t1.toLong()>t2.toLong()
timeD | the time duration to compare with the present instance |
References org.exolab.castor.types.Duration.toLong().
Referenced by org.exolab.castor.xml.validators.DurationValidator.validate().
boolean org.exolab.castor.types.Duration.isNegative | ( | ) |
static Object org.exolab.castor.types.Duration.parse | ( | String | str | ) | throws ParseException [static] |
parse a String and convert it into a java.lang.Object
str | the string to parse |
ParseException | a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class) |
References org.exolab.castor.types.Duration.parseDuration().
static Duration org.exolab.castor.types.Duration.parseDuration | ( | String | str | ) | throws ParseException [static] |
Parse the given string and return a time duration which represents this string.
String | str the string to parse |
ParseException | thrown when the string is not valid |
References org.exolab.castor.types.Duration.Duration().
Referenced by org.exolab.castor.types.Duration.parse(), and org.exolab.castor.xml.validators.DurationValidator.validate().
void org.exolab.castor.types.Duration.setDay | ( | short | day | ) |
void org.exolab.castor.types.Duration.setHour | ( | short | hour | ) |
void org.exolab.castor.types.Duration.setMilli | ( | long | milli | ) |
Referenced by org.exolab.castor.types.Duration.setValue().
void org.exolab.castor.types.Duration.setMinute | ( | short | minute | ) |
void org.exolab.castor.types.Duration.setMonth | ( | short | month | ) |
void org.exolab.castor.types.Duration.setNegative | ( | ) |
void org.exolab.castor.types.Duration.setSeconds | ( | short | second | ) |
void org.exolab.castor.types.Duration.setValue | ( | short | year, | |
short | month, | |||
short | day, | |||
short | hour, | |||
short | minute, | |||
short | second, | |||
long | millisecond | |||
) |
Fill in the fields of the duration with the given values
year | the year value | |
month | the month value | |
day | the day value | |
hour | the hour value | |
minute | the minute value | |
second | the second value |
References org.exolab.castor.types.Duration.setDay(), org.exolab.castor.types.Duration.setHour(), org.exolab.castor.types.Duration.setMilli(), org.exolab.castor.types.Duration.setMinute(), org.exolab.castor.types.Duration.setMonth(), org.exolab.castor.types.Duration.setSeconds(), and org.exolab.castor.types.Duration.setYear().
Referenced by org.exolab.castor.types.Duration.Duration().
void org.exolab.castor.types.Duration.setYear | ( | short | year | ) |
long org.exolab.castor.types.Duration.toLong | ( | ) |
Convert a duration into a long This long represents the duration in milliseconds.
References org.exolab.castor.types.Duration.isNegative().
Referenced by org.exolab.castor.types.Duration.isGreater(), org.exolab.castor.types.Duration.toString(), and org.exolab.castor.builder.types.XSDuration.validationCode().
String org.exolab.castor.types.Duration.toString | ( | ) |
Convert a duration into a String conforming to ISO8601 and XML Schema specs
References org.exolab.castor.types.Duration.toLong().