|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.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, microseconds, minutes, months, negative, normalized, seconds, years |
| Fields inherited from class net.sf.saxon.value.Value |
EMPTY_CLASS_ARRAY |
| Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
EMPTY_VALUE_ARRAY |
| 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)
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,
XPathContext context)
Convert to Java object (for passing to external functions) |
DecimalValue |
divide(DurationValue other)
Find the ratio between two durations |
static MonthDurationValue |
fromMonths(int months)
Construct a duration value as a number of months. |
ItemType |
getItemType(TypeHierarchy th)
Determine the data type of the exprssion |
int |
getLengthInMonths()
Get the number of months in the duration |
java.lang.CharSequence |
getStringValueCS()
Convert to string |
DurationValue |
multiply(double n)
Multiply duration by a number. |
DurationValue |
negate()
Negate a duration (same as subtracting from zero, but it preserves the type of the original duration) |
void |
normalize()
Normalize the value, for example 90M becomes 1H30M |
DurationValue |
subtract(DurationValue other)
Subtract two year-month-durations |
| Methods inherited from class net.sf.saxon.value.DurationValue |
badDuration, convertPrimitive, equals, getComponent, getLengthInSeconds, getStringValue, hashCode, normalizeDuration, normalizeZeroDuration, signum |
| Methods inherited from class net.sf.saxon.value.AtomicValue |
checkPermittedContents, convert, convert, display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getImplementationMethod, getLength, getPrimitiveValue, getTypedValue, hasBuiltInType, iterate, process, toString |
| Methods inherited from class net.sf.saxon.value.Value |
asItem, asIterator, asValue, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, optimize, promote, reduce, simplify, stringToNumber, typeCheck |
| 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.CharSequence getStringValueCS()
getStringValueCS in interface ItemgetStringValueCS in class DurationValuepublic void normalize()
public int getLengthInMonths()
public static MonthDurationValue fromMonths(int months)
public DurationValue multiply(double n)
throws XPathException
multiply in class DurationValueXPathException
public DecimalValue divide(DurationValue other)
throws XPathException
divide in class DurationValueother - the dividend
XPathException
public DurationValue add(DurationValue other)
throws XPathException
add in class DurationValueXPathException
public DurationValue subtract(DurationValue other)
throws XPathException
subtract in class DurationValueXPathExceptionpublic DurationValue negate()
negate in class DurationValuepublic ItemType getItemType(TypeHierarchy th)
getItemType in interface ExpressiongetItemType in class DurationValueth -
public java.lang.Object convertToJava(java.lang.Class target,
XPathContext context)
throws XPathException
convertToJava in class DurationValueXPathExceptionpublic int compareTo(java.lang.Object other)
compareTo in interface java.lang.Comparableother - 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 | |||||||||