|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.value.Value | +--net.sf.saxon.value.AtomicValue | +--net.sf.saxon.value.DurationValue | +--net.sf.saxon.value.MonthDurationValue
A value of type xsd:yearMonthDuration
Field Summary |
Fields inherited from class net.sf.saxon.value.DurationValue |
days, hours, milliseconds, minutes, months, negative, seconds, years |
Fields inherited from interface net.sf.saxon.expr.Expression |
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
MonthDurationValue(java.lang.CharSequence s)
Constructor: create a duration value from a supplied string, in ISO 8601 format [+|-]PnYnM |
Method Summary | |
DurationValue |
add(DurationValue other,
XPathContext context)
Add two year-month-durations |
int |
compareTo(java.lang.Object other)
Compare the value to another duration value |
java.lang.Object |
convertToJava(java.lang.Class target,
Configuration config,
XPathContext context)
Convert to Java object (for passing to external functions) |
DoubleValue |
divide(DurationValue other,
XPathContext context)
Find the ratio between two durations |
static MonthDurationValue |
fromMonths(int months)
Construct a duration value as a number of months. |
ItemType |
getItemType()
Determine the data type of the exprssion |
int |
getLengthInMonths()
Get the number of months in the duration |
java.lang.String |
getStringValue()
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 year-month-durations |
Methods inherited from class net.sf.saxon.value.DurationValue |
badDuration, convert, equals, getComponent, getLengthInSeconds, hashCode |
Methods inherited from class net.sf.saxon.value.AtomicValue |
convert, display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getImplementationMethod, getPrimitiveValue, getTypedValue, iterate, process, toString |
Methods inherited from class net.sf.saxon.value.Value |
analyze, asItem, asValue, collapseWhitespace, convertJavaObjectToXPath, getDependencies, getParentExpression, getSpecialProperties, inverse, iterateSubExpressions, normalizeWhitespace, promote, simplify, stringToNumber, trimWhitespace |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MonthDurationValue(java.lang.CharSequence s) throws XPathException
Method Detail |
public java.lang.String getStringValue()
getStringValue
in interface Item
getStringValue
in class DurationValue
public void normalize()
public int getLengthInMonths()
public static MonthDurationValue fromMonths(int months)
public DurationValue multiply(double n, XPathContext context)
multiply
in class DurationValue
public DoubleValue divide(DurationValue other, XPathContext context) throws XPathException
divide
in class DurationValue
other
- the dividend
XPathException
public DurationValue add(DurationValue other, XPathContext context) throws XPathException
add
in class DurationValue
XPathException
public DurationValue subtract(DurationValue other, XPathContext context) throws XPathException
subtract
in class DurationValue
XPathException
public ItemType getItemType()
getItemType
in interface Expression
getItemType
in class DurationValue
public java.lang.Object convertToJava(java.lang.Class target, Configuration config, XPathContext context) throws XPathException
convertToJava
in class DurationValue
target
- The class required by the external functionconfig
- The configuration (needed for access to schema information)
XPathException
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
compareTo
in class DurationValue
other
- The other dateTime value
java.lang.ClassCastException
- if the other value is not a DateTimeValue (the parameter
is declared as Object to satisfy the Comparable interface)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |