org.apache.axis.types
public class Duration extends Object implements Serializable
See Also: XML Schema 3.2.6
Constructor Summary | |
---|---|
Duration()
Default no-arg constructor | |
Duration(boolean negative, int aYears, int aMonths, int aDays, int aHours, int aMinutes, double aSeconds) | |
Duration(String duration)
Constructs Duration from a String in an xsd:duration format -
PnYnMnDTnHnMnS.
| |
Duration(boolean negative, Calendar calendar)
Constructs Duration from a Calendar.
|
Method Summary | |
---|---|
boolean | equals(Object object)
The equals method compares the time represented by duration object, not
its string representation.
|
Calendar | getAsCalendar()
Returns duration as a calendar. |
Calendar | getAsCalendar(Calendar startTime)
Returns duration as a calendar. |
int | getDays() |
int | getHours() |
int | getMinutes() |
int | getMonths() |
double | getSeconds() |
int | getYears() |
int | hashCode() |
boolean | isNegative() |
void | parseDate(String date)
This method parses the date portion of a String that represents
xsd:duration - nYnMnD.
|
void | parseTime(String time)
This method parses the time portion of a String that represents
xsd:duration - nHnMnS.
|
void | setDays(int days) |
void | setHours(int hours) |
void | setMinutes(int minutes) |
void | setMonths(int months) |
void | setNegative(boolean negative) |
void | setSeconds(int seconds) |
void | setSeconds(double seconds)
Sets the seconds. |
void | setYears(int years) |
String | toString()
This returns the xml representation of an xsd:duration object. |
Parameters: negative aYears aMonths aDays aHours aMinutes aSeconds
Parameters: duration String
Throws: SchemaException if the string doesn't parse correctly.
Parameters: calendar Calendar
Throws: IllegalArgumentException if the calendar object does not represent any date nor time.
Parameters: object
Returns: Calendar
Parameters: startTime Calendar
Returns: Calendar
Parameters: date
Throws: IllegalArgumentException if date does not match pattern
Parameters: time
Throws: IllegalArgumentException if time does not match pattern
Parameters: days
Parameters: hours
Parameters: minutes
Parameters: months
Parameters: negative
Deprecated: use {@link #setSeconds(double) setSeconds(double)} instead
Parameters: seconds
Parameters: seconds double
Parameters: years