com.xml_project.morganaxdm
Class XS_DateTime

java.lang.Object
  extended by com.xml_project.morganaxdm.XdmSequence
      extended by com.xml_project.morganaxdm.XdmItem
          extended by com.xml_project.morganaxdm.XdmValue
              extended by com.xml_project.morganaxdm.XS_AnySimpleType
                  extended by com.xml_project.morganaxdm.XS_AnyAtomicType
                      extended by com.xml_project.morganaxdm.XS_Calendar
                          extended by com.xml_project.morganaxdm.XS_DateTime
All Implemented Interfaces:
XS_AnyType, java.lang.Iterable<XdmItem>

public class XS_DateTime
extends XS_Calendar

Implementation of xs:dateTime


Nested Class Summary
 
Nested classes/interfaces inherited from class com.xml_project.morganaxdm.XS_AnyAtomicType
XS_AnyAtomicType.ValueComparers
 
Field Summary
static javax.xml.namespace.QName TypeName
           
 
Fields inherited from class com.xml_project.morganaxdm.XS_Calendar
DaysInMonth, NoTimeZone, StandardDate
 
Constructor Summary
protected XS_DateTime(int timezone, XS_Date.Date aDate)
           
  XS_DateTime(int timezone, XS_Date.Date aDate, com.xml_project.morganaxdm.XS_Time.Time aTime)
           
protected XS_DateTime(int timezone, com.xml_project.morganaxdm.XS_Time.Time aTime)
           
 
Method Summary
static XS_DateTime addDuration(XS_DateTime org, XS_Duration dur)
          Calculates a new xs:dateTime by adding duration to the existing value
protected  void addDuration(XS_Duration.Duration d)
          Adds a duration to this xs:dateTime
protected  XS_DateTime adjustToZ()
          Transforms dateTime to corresponding dateTime at Z if timezone is present The dateTime is not converted using implicit timezone
protected  int compare(XS_DateTime other)
           
 XS_DateTime copy()
           
static XS_DateTime create(java.util.GregorianCalendar cal)
           
static XS_DateTime create(long millis)
           
static XS_dayTimeDuration diff(XS_DateTime d1, XS_DateTime d2, DynamicXQueryContext context)
          Calculates difference between two dateTimes as dayTimeDuration
static XS_DateTime getCurrentDateTime()
           
protected  XS_Date.Date getDate()
           
static java.lang.Class<? extends XS_AnyType> getRestrictionBase()
           
 java.lang.String getStringValue()
          Returns the string value.
protected  com.xml_project.morganaxdm.XS_Time.Time getTime()
           
 javax.xml.namespace.QName getTypeName()
           
 java.lang.Object getValue()
          Returns the value itself.
 boolean isOrdered()
           
 long makeToMillis()
           
 XS_Date makeToXS_Date()
           
 XS_DateTime makeToXS_DateTime()
           
 XS_Time makeToXS_Time()
           
static XS_DateTime newInstance(XdmValue value)
           
static XS_DateTime subDuration(XS_DateTime org, XS_Duration dur)
          Calculates a new xs:dateTime by adding -duration to the existing value
 
Methods inherited from class com.xml_project.morganaxdm.XS_Calendar
checkDigits, clearTimezone, compareValues, getComponent, getMicrosecondsAsString, getTimezone, getTimezoneAsDuration, getTimezoneAsXS_dayTimeDuration, getTimezoneXMLValue, hasTimezone, make2Digits, make4Digits, parseTimezone, setTimezone, setTimezone, splitTimezoneFromTime
 
Methods inherited from class com.xml_project.morganaxdm.XS_AnyAtomicType
compareValue, makeCompareResult, test
 
Methods inherited from class com.xml_project.morganaxdm.XS_AnySimpleType
compareValues, isValue
 
Methods inherited from class com.xml_project.morganaxdm.XdmValue
atomize
 
Methods inherited from class com.xml_project.morganaxdm.XdmItem
first, get, hasValues, isEmpty, iterator, size, subSequence
 
Methods inherited from class com.xml_project.morganaxdm.XdmSequence
concat, hasCommonType, normalize, serialize, serialize, serialize, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TypeName

public static final javax.xml.namespace.QName TypeName
Constructor Detail

XS_DateTime

protected XS_DateTime(int timezone,
                      XS_Date.Date aDate)

XS_DateTime

protected XS_DateTime(int timezone,
                      com.xml_project.morganaxdm.XS_Time.Time aTime)

XS_DateTime

public XS_DateTime(int timezone,
                   XS_Date.Date aDate,
                   com.xml_project.morganaxdm.XS_Time.Time aTime)
Method Detail

getTypeName

public javax.xml.namespace.QName getTypeName()

getStringValue

public java.lang.String getStringValue()
Description copied from class: XdmItem
Returns the string value.

Specified by:
getStringValue in class XdmItem
Returns:
the string value.

getTime

protected com.xml_project.morganaxdm.XS_Time.Time getTime()

getDate

protected XS_Date.Date getDate()

getValue

public java.lang.Object getValue()
Description copied from class: XdmItem
Returns the value itself.

Specified by:
getValue in class XdmItem
Returns:
the value.

isOrdered

public boolean isOrdered()
Specified by:
isOrdered in class XS_AnyAtomicType

newInstance

public static XS_DateTime newInstance(XdmValue value)
                               throws XPathException
Throws:
XPathException

getRestrictionBase

public static java.lang.Class<? extends XS_AnyType> getRestrictionBase()

makeToMillis

public long makeToMillis()

makeToXS_DateTime

public XS_DateTime makeToXS_DateTime()
Specified by:
makeToXS_DateTime in class XS_Calendar

makeToXS_Date

public XS_Date makeToXS_Date()

makeToXS_Time

public XS_Time makeToXS_Time()

compare

protected int compare(XS_DateTime other)
               throws XPathException
Throws:
XPathException

adjustToZ

protected XS_DateTime adjustToZ()
Transforms dateTime to corresponding dateTime at Z if timezone is present The dateTime is not converted using implicit timezone


addDuration

protected void addDuration(XS_Duration.Duration d)
Adds a duration to this xs:dateTime

Parameters:
d -

copy

public XS_DateTime copy()

addDuration

public static XS_DateTime addDuration(XS_DateTime org,
                                      XS_Duration dur)
Calculates a new xs:dateTime by adding duration to the existing value

Parameters:
org -
dur -
Returns:
the calculated dateTime

subDuration

public static XS_DateTime subDuration(XS_DateTime org,
                                      XS_Duration dur)
Calculates a new xs:dateTime by adding -duration to the existing value

Parameters:
org -
dur -
Returns:
the calculated dateTime

create

public static XS_DateTime create(long millis)

create

public static XS_DateTime create(java.util.GregorianCalendar cal)

getCurrentDateTime

public static XS_DateTime getCurrentDateTime()

diff

public static XS_dayTimeDuration diff(XS_DateTime d1,
                                      XS_DateTime d2,
                                      DynamicXQueryContext context)
Calculates difference between two dateTimes as dayTimeDuration

Parameters:
d1 -
d2 -
Returns:
the calculated dayTimeDuration