org.exist.xquery.value
Class DateTimeValue

java.lang.Object
  extended byorg.exist.xquery.value.AtomicValue
      extended byorg.exist.xquery.value.ComputableValue
          extended byorg.exist.xquery.value.AbstractDateTimeValue
              extended byorg.exist.xquery.value.DateTimeValue
All Implemented Interfaces:
java.lang.Comparable, Indexable, Item, Sequence

public class DateTimeValue
extends AbstractDateTimeValue
implements Indexable

Represents a value of type xs:dateTime.

Author:
Wolfgang Meier (wolfgang@exist-db.org), Piotr Kaminski

Field Summary
 
Fields inherited from class org.exist.xquery.value.AbstractDateTimeValue
calendar, DAY, HOUR, MILLISECOND, MINUTE, MONTH, SECOND, 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
DateTimeValue()
           
DateTimeValue(XMLGregorianCalendar calendar)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 AtomicValue convertTo(int requiredType)
          Convert this item into an atomic value, whose type corresponds to the specified target type.
protected  AbstractDateTimeValue createSameKind(XMLGregorianCalendar cal)
           
 java.util.Date getDate()
           
 int getType()
          Returns the type of the Indexable as one of the constants defined in Type.
protected  QName getXMLSchemaType()
           
 ComputableValue minus(ComputableValue other)
           
 byte[] serialize(short collectionId, boolean caseSensitive)
          Serialize the value plus collection and possibly element information to an array of bytes.
 byte[] serializeValue(int offset, boolean caseSensitive)
          Serialize for the persistant storage
 
Methods inherited from class org.exist.xquery.value.AbstractDateTimeValue
adjustedToTimezone, compareTo, compareTo, conversionPreference, div, getCanonicalCalendar, getImplicitCalendar, getPart, getStringValue, getTimeInMillis, getTimezone, getTrimmedCalendar, max, min, mult, plus, toJavaObject, validateTimezone, withoutTimezone
 
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
 

Constructor Detail

DateTimeValue

public DateTimeValue()
              throws XPathException

DateTimeValue

public DateTimeValue(XMLGregorianCalendar calendar)
Method Detail

createSameKind

protected AbstractDateTimeValue createSameKind(XMLGregorianCalendar cal)
                                        throws XPathException
Specified by:
createSameKind in class AbstractDateTimeValue
Throws:
XPathException

getXMLSchemaType

protected QName getXMLSchemaType()
Specified by:
getXMLSchemaType in class AbstractDateTimeValue

getType

public int getType()
Description copied from interface: Indexable
Returns the type of the Indexable as one of the constants defined in Type.

Specified by:
getType in interface Indexable
Overrides:
getType in class AtomicValue

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 class AbstractDateTimeValue
Throws:
XPathException

minus

public ComputableValue minus(ComputableValue other)
                      throws XPathException
Specified by:
minus in class ComputableValue
Throws:
XPathException

getDate

public java.util.Date getDate()

serialize

public byte[] serialize(short collectionId,
                        boolean caseSensitive)
Deprecated.  

Description copied from interface: Indexable
Serialize the value plus collection and possibly element information to an array of bytes.

Specified by:
serialize in interface Indexable
Parameters:
collectionId - the collection id to use
caseSensitive - only relevant for string values: if set to false, strings should be serialized in lower case
Returns:
See Also:
org.exist.storage.Indexable#serialize(short)

serializeValue

public byte[] serializeValue(int offset,
                             boolean caseSensitive)
Serialize for the persistant storage

Specified by:
serializeValue in interface Indexable
Returns:
the size actually writen in the array argument

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable


<oXygen/> XML Editor provides support for editing and debugging XQuery expressions against the eXist XML Database.