net.sf.saxon.value
public final class SecondsDurationValue extends DurationValue implements Comparable
Constructor Summary | |
---|---|
SecondsDurationValue(CharSequence s)
Constructor: create a duration value from a supplied string, in
ISO 8601 format [-]PnDTnHnMnS | |
SecondsDurationValue(int sign, int days, int hours, int minutes, int seconds, int microseconds)
Create a dayTimeDuration given the number of days, hours, minutes, and seconds |
Method Summary | |
---|---|
DurationValue | add(DurationValue other, XPathContext context)
Add two dayTimeDurations |
int | compareTo(Object other)
Compare the value to another duration value |
Object | convertToJava(Class target, XPathContext context)
Convert to Java object (for passing to external functions) |
DecimalValue | divide(DurationValue other, XPathContext context)
Find the ratio between two durations |
static SecondsDurationValue | fromMicroseconds(long microseconds)
Construct a duration value as a number of microseconds. |
static SecondsDurationValue | fromMilliseconds(long milliseconds)
Construct a duration value as a number of milliseconds. |
static SecondsDurationValue | fromSeconds(BigDecimal seconds)
Construct a duration value as a number of seconds. |
ItemType | getItemType(TypeHierarchy th)
Determine the data type of the exprssion |
long | getLengthInMicroseconds()
Get length of duration in microseconds, as a long |
long | getLengthInMilliseconds()
Get length of duration in milliseconds, as a long |
double | getLengthInSeconds()
Get length of duration in seconds |
CharSequence | getStringValueCS()
Convert to string |
DurationValue | multiply(double n, XPathContext context)
Multiply duration by a number. |
void | normalize()
Normalize the value, for example 90M becomes 1H30M |
DurationValue | subtract(DurationValue other, XPathContext context)
Subtract two dayTime-durations |
Parameters: other The other dateTime value
Returns: negative value if this one is the earler, 0 if they are chronologically equal, positive value if this one is the later. For this purpose, dateTime values with an unknown timezone are considered to be UTC values (the Comparable interface requires a total ordering).
Throws: ClassCastException if the other value is not a DateTimeValue (the parameter is declared as Object to satisfy the Comparable interface)
Parameters: other the dividend
Returns: the ratio, as a decimal
Throws: XPathException
Parameters: th
Returns: Type.DAY_TIME_DURATION,
Returns: ISO 8601 representation.