java.io.Serializable
public class TimeDuration
extends java.lang.Object
implements java.io.Serializable
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'
Note: This datatype is not included in any recommendation. It was introduced in http://www.w3.org/TR/1999/WD-xmlschema-2-19990924/ and was last in http://www.w3.org/TR/2000/CR-xmlschema-2-20001024/ and was removed by http://www.w3.org/TR/2001/PR-xmlschema-2-20010316/. It was not in the final approved recommendation: http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/
Constructor | Description |
---|---|
TimeDuration() |
Deprecated.
default constructor
|
TimeDuration(long l) |
Deprecated.
This constructor fills in the time duration fields according to the
value of the long by calling setValue
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equal(TimeDuration timeD) |
Deprecated.
Returns true if the instance of TimeDuration has the same fields
of the parameter
|
boolean |
equals(java.lang.Object object) |
Deprecated.
Override the java.lang.equals method
|
short |
getDay() |
Deprecated.
|
short |
getHour() |
Deprecated.
|
short |
getMilli() |
Deprecated.
|
short |
getMinute() |
Deprecated.
|
short |
getMonth() |
Deprecated.
|
short |
getSeconds() |
Deprecated.
|
short |
getYear() |
Deprecated.
|
boolean |
isGreater(TimeDuration timeD) |
Deprecated.
Returns true if the present instance of TimeDuration is greater than
the parameter
|
boolean |
isNegative() |
Deprecated.
|
static java.lang.Object |
parse(java.lang.String str) |
Deprecated.
parse a String and convert it into a java.lang.Object
|
static TimeDuration |
parseTimeDuration(java.lang.String str) |
Deprecated.
Parse the given string and return a time duration
which represents this string
|
void |
setDay(short day) |
Deprecated.
|
void |
setHour(short hour) |
Deprecated.
|
void |
setMilli(short milli) |
Deprecated.
|
void |
setMinute(short minute) |
Deprecated.
|
void |
setMonth(short month) |
Deprecated.
|
void |
setNegative() |
Deprecated.
|
void |
setSeconds(short second) |
Deprecated.
|
void |
setValue(short year,
short month,
short day,
short hour,
short minute,
short second,
short millisecond) |
Deprecated.
Fill in the fields of the TimeDuration with the given values
|
void |
setYear(short year) |
Deprecated.
|
long |
toLong() |
Deprecated.
Convert a timeDuration into a long
This long represents the duration in milliseconds
|
java.lang.String |
toString() |
Deprecated.
Convert a timeDuration into a String
conforming to ISO8601 and
XML Schema specs
|
public TimeDuration()
public TimeDuration(long l)
This constructor fills in the time duration fields according to the value of the long by calling setValue
l
- the long value of the Time DurationsetValue(short, short, short, short, short, short, short)
public void setYear(short year)
public void setMonth(short month)
public void setDay(short day)
public void setHour(short hour)
public void setMinute(short minute)
public void setSeconds(short second)
public void setMilli(short milli)
public void setNegative()
public void setValue(short year, short month, short day, short hour, short minute, short second, short millisecond)
year
- the year valuemonth
- the month valueday
- the day valuehour
- the hour valueminute
- the minute valuesecond
- the second valuepublic short getYear()
public short getMonth()
public short getDay()
public short getHour()
public short getMinute()
public short getSeconds()
public short getMilli()
public boolean isNegative()
public long toLong()
Convert a timeDuration into a long This long represents the duration in milliseconds
public java.lang.String toString()
Convert a timeDuration into a String conforming to ISO8601 and XML Schema specs
toString
in class java.lang.Object
public static java.lang.Object parse(java.lang.String str) throws java.text.ParseException
str
- the string to parsejava.text.ParseException
- a parse exception is thrown if the string to parse
does not follow the rigth format (see the description
of this class)public static TimeDuration parseTimeDuration(java.lang.String str) throws java.text.ParseException
Parse the given string and return a time duration which represents this string
str
- the string to parsejava.text.ParseException
- thrown when the string is not validpublic boolean equals(java.lang.Object object)
equals
in class java.lang.Object
equal(org.exolab.castor.types.TimeDuration)
public boolean equal(TimeDuration timeD)
timeD
- the time duration to comparepublic boolean 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()
timeD
- the time duration to compare with the present instanceIntalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com