org.exist.xquery.value
Class YearMonthDurationValue

java.lang.Object
  extended byorg.exist.xquery.value.AtomicValue
      extended byorg.exist.xquery.value.ComputableValue
          extended byorg.exist.xquery.value.DurationValue
              extended byorg.exist.xquery.value.OrderedDurationValue
                  extended byorg.exist.xquery.value.YearMonthDurationValue
All Implemented Interfaces:
Item, Sequence

public class YearMonthDurationValue
extends org.exist.xquery.value.OrderedDurationValue

Author:
Piotr Kaminski

Field Summary
static Duration CANONICAL_ZERO_DURATION
           
 
Fields inherited from class org.exist.xquery.value.DurationValue
DAY, duration, HOUR, MINUTE, MONTH, SIXTY, SIXTY_DECIMAL, TWELVE, TWENTY_FOUR, YEAR, ZERO_DECIMAL
 
Fields inherited from class org.exist.xquery.value.AtomicValue
EMPTY_VALUE
 
Fields inherited from interface org.exist.xquery.value.Sequence
EMPTY_SEQUENCE
 
Method Summary
protected  Duration canonicalZeroDuration()
           
 int compareTo(java.text.Collator collator, AtomicValue other)
           
 boolean compareTo(java.text.Collator collator, int operator, AtomicValue other)
           
 AtomicValue convertTo(int requiredType)
          Convert this item into an atomic value, whose type corresponds to the specified target type.
protected  DurationValue createSameKind(Duration dur)
           
 ComputableValue div(ComputableValue other)
           
 java.lang.String getStringValue()
          Return the string value of this item (see the definition of string value in XPath).
 int getType()
          Return the type of this item according to the type constants defined in class Type.
 int getValue()
           
 AtomicValue max(java.text.Collator collator, AtomicValue other)
           
 AtomicValue min(java.text.Collator collator, AtomicValue other)
           
 ComputableValue minus(ComputableValue other)
           
 ComputableValue mult(ComputableValue other)
           
protected  java.math.BigDecimal numberToBigDecimal(ComputableValue x, java.lang.String exceptionMessagePrefix)
          Convert the given value to a big decimal if it's a number, keeping as much precision as possible.
 ComputableValue plus(ComputableValue other)
           
 
Methods inherited from class org.exist.xquery.value.DurationValue
conversionPreference, getCanonicalDuration, getPart, getSeconds, monthsValue, monthsValueSigned, negate, secondsValue, secondsValueSigned, toJavaObject
 
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
 

Field Detail

CANONICAL_ZERO_DURATION

public static final Duration CANONICAL_ZERO_DURATION
Method Detail

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 decimal
exceptionMessagePrefix - 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.