public final class YearMonthDurationValue extends DurationValue implements java.lang.Comparable
microseconds, months, negative, seconds
typeLabel
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING
EMPTY_VALUE_ARRAY
?????? | ????? |
---|---|
DurationValue |
add(DurationValue other)
Add two year-month-durations
|
int |
compareTo(java.lang.Object other)
Compare the value to another duration value
|
AtomicValue |
copyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value, with a different type label
|
DecimalValue |
divide(DurationValue other)
Find the ratio between two durations
|
static YearMonthDurationValue |
fromMonths(int months)
Construct a duration value as a number of months.
|
int |
getLengthInMonths()
Get the number of months in the duration
|
BuiltInAtomicType |
getPrimitiveType()
Determine the primitive type of the value.
|
java.lang.CharSequence |
getStringValueCS()
Convert to string
|
java.lang.Object |
getXPathComparable(boolean ordered,
StringCollator collator,
XPathContext context)
Get a Comparable value that implements the XPath ordering comparison semantics for this value.
|
static ConversionResult |
makeYearMonthDurationValue(java.lang.CharSequence s)
Static factory: create a duration value from a supplied string, in
ISO 8601 format [+|-]PnYnM
|
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)
|
DurationValue |
subtract(DurationValue other)
Subtract two year-month-durations
|
badDuration, convertPrimitive, equals, getComponent, getDays, getHours, getLengthInSeconds, getMicroseconds, getMinutes, getMonths, getSchemaComparable, getSchemaComparable, getSeconds, getStringValue, getYears, hashCode, makeDuration, normalizeDuration, normalizeZeroDuration, signum, simpleInteger
asAtomic, checkPermittedContents, convert, convert, effectiveBooleanValue, getCardinality, getItemType, getLength, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence, toString
asItem, asItem, asIterator, asValue, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, makeQNameValue, reduce, stringToNumber
public static ConversionResult makeYearMonthDurationValue(java.lang.CharSequence s)
s
- a string in the lexical space of xs:yearMonthDuration.public AtomicValue copyAsSubType(AtomicType typeLabel)
copyAsSubType
??? DurationValue
typeLabel
- the type label of the new copy. The caller is responsible for checking that
the value actually conforms to this type.public BuiltInAtomicType getPrimitiveType()
getPrimitiveType
??? DurationValue
public java.lang.CharSequence getStringValueCS()
getStringValueCS
???? Item
getStringValueCS
???? ValueRepresentation
getStringValueCS
??? DurationValue
Item.getStringValue()
public int getLengthInMonths()
public static YearMonthDurationValue fromMonths(int months)
months
- the number of months (may be negative)public DurationValue multiply(double n) throws XPathException
multiply
??? DurationValue
n
- the number to multiply byXPathException
public DecimalValue divide(DurationValue other) throws XPathException
divide
??? DurationValue
other
- the dividendXPathException
public DurationValue add(DurationValue other) throws XPathException
add
??? DurationValue
other
- the duration to be added to this oneXPathException
public DurationValue subtract(DurationValue other) throws XPathException
subtract
??? DurationValue
other
- the duration to be subtracted from this oneXPathException
public DurationValue negate()
negate
??? DurationValue
public int compareTo(java.lang.Object other)
compareTo
???? java.lang.Comparable
other
- The other dateTime valuejava.lang.ClassCastException
- if the other value is not a DateTimeValue (the parameter
is declared as Object to satisfy the Comparable interface)public java.lang.Object getXPathComparable(boolean ordered, StringCollator collator, XPathContext context)
getXPathComparable
??? DurationValue
ordered
- collator
- context
-