Public Member Functions | Static Public Member Functions

org.exolab.castor.types.TimeDuration Class Reference

List of all members.

Public Member Functions

 TimeDuration ()
 TimeDuration (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 (short milli)
void setNegative ()
void setValue (short year, short month, short day, short hour, short minute, short second, short millisecond)
short getYear ()
short getMonth ()
short getDay ()
short getHour ()
short getMinute ()
short getSeconds ()
short getMilli ()
boolean isNegative ()
long toLong ()
String toString ()
boolean equals (Object object)
boolean equal (TimeDuration timeD)
boolean isGreater (TimeDuration timeD)

Static Public Member Functions

static Object parse (String str) throws ParseException
static TimeDuration parseTimeDuration (String str) throws ParseException

Detailed Description

Represents the timeDuration XML Schema type.

This representation does not support the decimal fraction for the lowest order item. Besides setting TimeDuration to '0' is not possible thus there is no distinction between '0' and 'P0Y'

Author:
Arnaud Blandin
Version:
Revision:
1.1.1.1
Date:
2003/03/03 07:09:02

Constructor & Destructor Documentation

org.exolab.castor.types.TimeDuration.TimeDuration (  ) 
org.exolab.castor.types.TimeDuration.TimeDuration ( long  l  ) 

This constructor fills in the time duration fields according to the value of the long by calling setValue

See also:
setValue
Parameters:
l the long value of the Time Duration
Returns:
A time duration which represents the long

References org.exolab.castor.types.TimeDuration.setNegative(), and org.exolab.castor.types.TimeDuration.setValue().


Member Function Documentation

boolean org.exolab.castor.types.TimeDuration.equal ( TimeDuration  timeD  ) 
boolean org.exolab.castor.types.TimeDuration.equals ( Object  object  ) 
short org.exolab.castor.types.TimeDuration.getDay (  ) 
short org.exolab.castor.types.TimeDuration.getHour (  ) 
short org.exolab.castor.types.TimeDuration.getMilli (  ) 
short org.exolab.castor.types.TimeDuration.getMinute (  ) 
short org.exolab.castor.types.TimeDuration.getMonth (  ) 
short org.exolab.castor.types.TimeDuration.getSeconds (  ) 
short org.exolab.castor.types.TimeDuration.getYear (  ) 
boolean org.exolab.castor.types.TimeDuration.isGreater ( TimeDuration  timeD  ) 

Returns true if the present instance of TimeDuration is greater than the parameter

Note This definition does not follow the XML SCHEMA DRAFT 20001024 the following orger relation is used : t1,t2 timeDuration types t1>t2 iff t1.toLong()>t2.toLong()

Parameters:
timeD the time 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.toLong().

boolean org.exolab.castor.types.TimeDuration.isNegative (  ) 
static Object org.exolab.castor.types.TimeDuration.parse ( String  str  )  throws ParseException [static]

parse a String and convert it into a java.lang.Object

Parameters:
str the string to parse
Returns:
the java.lang.Object represented by the string
Exceptions:
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.TimeDuration.parseTimeDuration().

static TimeDuration org.exolab.castor.types.TimeDuration.parseTimeDuration ( String  str  )  throws ParseException [static]
void org.exolab.castor.types.TimeDuration.setDay ( short  day  ) 
void org.exolab.castor.types.TimeDuration.setHour ( short  hour  ) 
void org.exolab.castor.types.TimeDuration.setMilli ( short  milli  ) 
void org.exolab.castor.types.TimeDuration.setMinute ( short  minute  ) 
void org.exolab.castor.types.TimeDuration.setMonth ( short  month  ) 
void org.exolab.castor.types.TimeDuration.setNegative (  ) 
void org.exolab.castor.types.TimeDuration.setSeconds ( short  second  ) 
void org.exolab.castor.types.TimeDuration.setValue ( short  year,
short  month,
short  day,
short  hour,
short  minute,
short  second,
short  millisecond 
)
void org.exolab.castor.types.TimeDuration.setYear ( short  year  ) 
long org.exolab.castor.types.TimeDuration.toLong (  ) 

Convert a timeDuration into a long This long represents the duration in milliseconds

Returns:
a long representing the duration

References org.exolab.castor.types.TimeDuration.isNegative().

Referenced by org.exolab.castor.types.TimeDuration.isGreater().

String org.exolab.castor.types.TimeDuration.toString (  ) 

Convert a timeDuration into a String conforming to ISO8601 and XML Schema specs

Returns:
a string representing the time duration

Referenced by org.exolab.castor.types.TimeDurationDescriptor.TimeDurationFieldHandler.getValue().


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