org.exist.xquery.value
Class YearMonthDurationValue

java.lang.Object
  extended by org.exist.xquery.value.AtomicValue
      extended by org.exist.xquery.value.ComputableValue
          extended by org.exist.xquery.value.DurationValue
              extended by org.exist.xquery.value.YearMonthDurationValue
All Implemented Interfaces:
Comparable, Indexable, Item, Sequence

public class YearMonthDurationValue
extends DurationValue

Author:
Piotr Kaminski

Field Summary
static Duration CANONICAL_ZERO_DURATION
           
 
Fields inherited from class org.exist.xquery.value.DurationValue
DAY, HOUR, MINUTE, MONTH, YEAR
 
Fields inherited from class org.exist.xquery.value.AtomicValue
EMPTY_VALUE
 
Fields inherited from interface org.exist.xquery.value.Sequence
EMPTY_SEQUENCE
 
Constructor Summary
YearMonthDurationValue(String str)
           
 
Method Summary
 int compareTo(Collator collator, AtomicValue other)
           
 boolean compareTo(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.
 ComputableValue div(ComputableValue other)
           
 boolean effectiveBooleanValue()
          Get the effective boolean value of this sequence.
 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(Collator collator, AtomicValue other)
           
 AtomicValue min(Collator collator, AtomicValue other)
           
 ComputableValue minus(ComputableValue other)
           
 ComputableValue mult(ComputableValue other)
           
 ComputableValue plus(ComputableValue other)
           
 
Methods inherited from class org.exist.xquery.value.DurationValue
areReallyEqual, conversionPreference, getCanonicalDuration, getPart, getSeconds, negate, toJavaObject, wrap
 
Methods inherited from class org.exist.xquery.value.AtomicValue
add, addAll, atomize, clearContext, compareTo, contains, copyTo, dump, endsWith, getCardinality, getCollectionIterator, getDocumentSet, getItemCount, getItemType, getState, hasChanged, hasMany, hasOne, isCacheable, isCached, isEmpty, isPersistentSet, itemAt, iterate, nodeMoved, promote, removeDuplicates, serializeValue, setIsCached, setSelfAsContext, startsWith, toMemNodeSet, toNodeSet, toSAX, toSequence, toString, unorderedIterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CANONICAL_ZERO_DURATION

public static final Duration CANONICAL_ZERO_DURATION
Constructor Detail

YearMonthDurationValue

public YearMonthDurationValue(String str)
                       throws XPathException
Throws:
XPathException
Method Detail

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 Indexable
Specified by:
getType in interface Item
Overrides:
getType in class DurationValue
Returns:
Type of the Indexable

getStringValue

public 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
Specified by:
getStringValue in interface Sequence
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
Specified by:
convertTo in interface Sequence
Overrides:
convertTo in class DurationValue
Parameters:
requiredType - one of the type constants defined in class Type
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

effectiveBooleanValue

public boolean effectiveBooleanValue()
                              throws XPathException
Description copied from interface: Sequence
Get the effective boolean value of this sequence. Will be false if the sequence is empty, true otherwise.

Specified by:
effectiveBooleanValue in interface Sequence
Overrides:
effectiveBooleanValue in class DurationValue
Throws:
XPathException

compareTo

public boolean compareTo(Collator collator,
                         int operator,
                         AtomicValue other)
                  throws XPathException
Overrides:
compareTo in class DurationValue
Throws:
XPathException

compareTo

public int compareTo(Collator collator,
                     AtomicValue other)
              throws XPathException
Overrides:
compareTo in class DurationValue
Throws:
XPathException

max

public AtomicValue max(Collator collator,
                       AtomicValue other)
                throws XPathException
Overrides:
max in class DurationValue
Throws:
XPathException

min

public AtomicValue min(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


Copyright (C) Wolfgang Meier. All rights reserved.