org.exist.xquery.value
Class YearMonthDurationValue
java.lang.Object
org.exist.xquery.value.AtomicValue
org.exist.xquery.value.ComputableValue
org.exist.xquery.value.DurationValue
org.exist.xquery.value.OrderedDurationValue
org.exist.xquery.value.YearMonthDurationValue
- All Implemented Interfaces:
- Item, Sequence
- public class YearMonthDurationValue
- extends org.exist.xquery.value.OrderedDurationValue
- Author:
- Piotr Kaminski
| Fields inherited from class org.exist.xquery.value.DurationValue |
DAY, duration, HOUR, MINUTE, MONTH, SIXTY, SIXTY_DECIMAL, TWELVE, TWENTY_FOUR, YEAR, ZERO_DECIMAL |
| Methods inherited from class org.exist.xquery.value.AtomicValue |
add, addAll, atomize, clearContext, contains, copyTo, dump, effectiveBooleanValue, endsWith, getCardinality, getDocumentSet, getItemType, getLength, isCached, isPersistentSet, itemAt, iterate, removeDuplicates, setIsCached, setSelfAsContext, startsWith, toNodeSet, toSAX, toSequence, toString, unorderedIterator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CANONICAL_ZERO_DURATION
public static final Duration CANONICAL_ZERO_DURATION
canonicalZeroDuration
protected Duration canonicalZeroDuration()
- Overrides:
canonicalZeroDuration in class DurationValue
getValue
public int getValue()
getType
public int getType()
- Description copied from interface:
Item
- Return the type of this item according to the type constants defined in class
Type.
- Specified by:
getType in interface Item- Overrides:
getType in class DurationValue
getStringValue
public java.lang.String getStringValue()
- Description copied from interface:
Item
- Return the string value of this item (see the definition of string value in XPath).
- Specified by:
getStringValue in interface Item- Overrides:
getStringValue in class DurationValue
convertTo
public AtomicValue convertTo(int requiredType)
throws XPathException
- Description copied from interface:
Item
- Convert this item into an atomic value, whose type corresponds to
the specified target type. requiredType should be one of the type
constants defined in
Type. An XPathException is thrown
if the conversion is impossible.
- Specified by:
convertTo in interface Item- Overrides:
convertTo in class DurationValue
- Throws:
XPathException
createSameKind
protected DurationValue createSameKind(Duration dur)
throws XPathException
- Overrides:
createSameKind in class DurationValue
- Throws:
XPathException
plus
public ComputableValue plus(ComputableValue other)
throws XPathException
- Throws:
XPathException
mult
public ComputableValue mult(ComputableValue other)
throws XPathException
- Overrides:
mult in class DurationValue
- Throws:
XPathException
div
public ComputableValue div(ComputableValue other)
throws XPathException
- Overrides:
div in class DurationValue
- Throws:
XPathException
compareTo
public boolean compareTo(java.text.Collator collator,
int operator,
AtomicValue other)
throws XPathException
- Overrides:
compareTo in class DurationValue
- Throws:
XPathException
compareTo
public int compareTo(java.text.Collator collator,
AtomicValue other)
throws XPathException
- Overrides:
compareTo in class DurationValue
- Throws:
XPathException
max
public AtomicValue max(java.text.Collator collator,
AtomicValue other)
throws XPathException
- Overrides:
max in class DurationValue
- Throws:
XPathException
min
public AtomicValue min(java.text.Collator collator,
AtomicValue other)
throws XPathException
- Overrides:
min in class DurationValue
- Throws:
XPathException
minus
public ComputableValue minus(ComputableValue other)
throws XPathException
- Overrides:
minus in class DurationValue
- Throws:
XPathException
numberToBigDecimal
protected java.math.BigDecimal numberToBigDecimal(ComputableValue x,
java.lang.String exceptionMessagePrefix)
throws XPathException
- Convert the given value to a big decimal if it's a number, keeping as much precision
as possible.
- Parameters:
x - a value to convert to a big decimalexceptionMessagePrefix - the beginning of the message to throw in an exception, will be suffixed with the type of the value given
- Returns:
- the big decimal equivalent of the value
- Throws:
XPathException - if the value is not of a numeric type
<oXygen/>
XML Editor
provides support for editing and debugging XQuery
expressions against the eXist XML Database.