de.fraunhofer.ipsi.xpathDatatypes
Class XS_Date

java.lang.Object
  extended by de.fraunhofer.ipsi.xpathDatatypes.XS_AnySimpleType
      extended by de.fraunhofer.ipsi.xpathDatatypes.XDT_AnyAtomicType
          extended by de.fraunhofer.ipsi.xpathDatatypes.XS_Date
All Implemented Interfaces:
java.lang.Comparable

public class XS_Date
extends XDT_AnyAtomicType
implements java.lang.Comparable


Constructor Summary
XS_Date(boolean positive, int years, int months, int days)
          Constructor
XS_Date(java.lang.String s)
          Constructor
 
Method Summary
 XS_Date add(XDT_DayTimeDuration dayTimeDuration)
          Method add
 XS_Date add(XDT_YearMonthDuration yearMonthDuration)
          Method addToDate
<T extends XDT_AnyAtomicType>
T
castas(java.lang.Class<T> type)
          Method castas
 int compareTo(java.lang.Object o)
          Method compareTo
static XS_Date currentDate()
          Method currentDate
 XS_Integer getDay()
          Method getDayFromDate
 XS_Integer getMonth()
          Method getMonthFromDate
 XS_Integer getYear()
          Method getYearFromDate
 XS_Boolean isPositive()
          Returns Positive
 XS_Date secondsToDate(double seconds, boolean positive)
          Method secondsToDate
 XS_Date subtract(XDT_DayTimeDuration dayTimeDuration)
          Method subtract
 XS_Date subtract(XDT_YearMonthDuration yearMonthDuration)
          Method subtractFromDate
 double toSeconds()
          Method toSeconds
 java.lang.String toString()
          Method toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XS_Date

public XS_Date(boolean positive,
               int years,
               int months,
               int days)
Constructor

Parameters:
positive - a boolean
years - an int
months - an int
days - an int

XS_Date

public XS_Date(java.lang.String s)
Constructor

Parameters:
date - a XS_String
Method Detail

toString

public java.lang.String toString()
Method toString

Overrides:
toString in class java.lang.Object
Returns:
a String

currentDate

public static XS_Date currentDate()
Method currentDate

Returns:
XS_Date

castas

public <T extends XDT_AnyAtomicType> T castas(java.lang.Class<T> type)
                                   throws java.lang.ClassCastException,
                                          XPathDTException
Method castas

Overrides:
castas in class XDT_AnyAtomicType
Parameters:
type - a BuiltinSimpleType
Returns:
a XS_AnySimpleType
Throws:
CastError
java.lang.ClassCastException
XPathDTException

compareTo

public int compareTo(java.lang.Object o)
Method compareTo

Specified by:
compareTo in interface java.lang.Comparable
Returns:
XS_Boolean

getYear

public XS_Integer getYear()
Method getYearFromDate

Parameters:
type - XS_Date
Returns:
XS_Integer

getMonth

public XS_Integer getMonth()
Method getMonthFromDate

Parameters:
type - XS_Date
Returns:
XS_Integer

getDay

public XS_Integer getDay()
Method getDayFromDate

Parameters:
type - XS_Date
Returns:
XS_Integer

toSeconds

public double toSeconds()
Method toSeconds

Returns:
double

secondsToDate

public XS_Date secondsToDate(double seconds,
                             boolean positive)
Method secondsToDate

Parameters:
double -
Returns:
XS_Date

add

public XS_Date add(XDT_DayTimeDuration dayTimeDuration)
Method add

Returns:
XS_DayTime

subtract

public XS_Date subtract(XDT_DayTimeDuration dayTimeDuration)
Method subtract

Returns:
XS_Date

add

public XS_Date add(XDT_YearMonthDuration yearMonthDuration)
Method addToDate

Returns:
XS_Date

subtract

public XS_Date subtract(XDT_YearMonthDuration yearMonthDuration)
Method subtractFromDate

Returns:
XS_Date

isPositive

public XS_Boolean isPositive()
Returns Positive

Returns:
a boolean