de.fraunhofer.ipsi.xpathDatatypes
Class XDT_YearMonthDuration

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.XDT_YearMonthDuration
All Implemented Interfaces:
java.lang.Comparable

public class XDT_YearMonthDuration
extends XDT_AnyAtomicType
implements java.lang.Comparable


Field Summary
 boolean positive
           
 
Constructor Summary
XDT_YearMonthDuration(boolean positive, java.math.BigInteger years, java.math.BigInteger months)
          Constructor
XDT_YearMonthDuration(java.lang.String s)
          Constructor
 
Method Summary
 XDT_YearMonthDuration add(XDT_YearMonthDuration yearMonthDuration)
          Method addYearMonthDurations
<T extends XDT_AnyAtomicType>
T
castas(java.lang.Class<T> type)
          Method castas
 int compareTo(java.lang.Object o)
          Method compareTo
 XDT_YearMonthDuration divide(XS_Decimal divide)
          Method divideYearMonthDuration
 XS_Integer getMonths()
          Method getMonthsFromYearMonthDuration
 XS_Integer getYears()
          Method getYearsFromYearMonthDuration
 XDT_YearMonthDuration multiply(XS_Decimal multiply)
          Method multiplyYearMonthDurations
 XDT_YearMonthDuration subtract(XDT_YearMonthDuration yearMonthDuration)
          Method subtractYearMonthDurations
 int toMonths()
          Method toMonths
 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
 

Field Detail

positive

public final boolean positive
Constructor Detail

XDT_YearMonthDuration

public XDT_YearMonthDuration(boolean positive,
                             java.math.BigInteger years,
                             java.math.BigInteger months)
Constructor

Parameters:
positive - a boolean
years - a BigInteger
months - a BigInteger

XDT_YearMonthDuration

public XDT_YearMonthDuration(java.lang.String s)
Constructor

Parameters:
yearMonthDuration - a XS_String
Method Detail

toString

public java.lang.String toString()
Method toString

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

compareTo

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

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

getYears

public XS_Integer getYears()
Method getYearsFromYearMonthDuration

Returns:
XS_Integer

getMonths

public XS_Integer getMonths()
Method getMonthsFromYearMonthDuration

Returns:
XS_Integer

add

public XDT_YearMonthDuration add(XDT_YearMonthDuration yearMonthDuration)
Method addYearMonthDurations

Parameters:
type - XS_YearMonthDuration
Returns:
XS_YearMonthDuration

subtract

public XDT_YearMonthDuration subtract(XDT_YearMonthDuration yearMonthDuration)
Method subtractYearMonthDurations

Parameters:
type - XS_YearMonthDuration
Returns:
XS_YearMonthDuration

multiply

public XDT_YearMonthDuration multiply(XS_Decimal multiply)
Method multiplyYearMonthDurations

Parameters:
type - XS_Decimal
Returns:
XS_YearMonthDuration

divide

public XDT_YearMonthDuration divide(XS_Decimal divide)
Method divideYearMonthDuration

Parameters:
type - XS_Decimal
Returns:
XS_YearMonthDuration

toMonths

public int toMonths()
Method toMonths

Returns:
an int

toSeconds

public double toSeconds()
Method toSeconds

Returns:
double

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