fi.hut.tml.xsmiles.mlfc.xforms.data
Class Duration

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.xforms.data.Duration

public class Duration
extends java.lang.Object

This class contains a duration object.


Field Summary
static java.lang.String du
           
 
Constructor Summary
Duration(int[] xercesduration)
          Added by JJK to support Xerces' stopgap internal representation as delivered through DTMSequence.
Duration(int year, int month, int day, int hour, int minute, double second)
           
Duration(java.lang.String duration)
          The duration string must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes].
 
Method Summary
 Duration addDTDuration(Duration du)
           
 Duration addYMDuration(Duration d)
           
 Duration divideDTDuration(double dec)
           
 Duration divideYMDuration(double dec)
           
static Duration DTDuration(java.lang.String duration)
           
static Duration DTDurationFromSecs(double secs)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean DTEqual(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean DTGreaterThan(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean DTGreaterThanOrEqual(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean DTLessThan(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean DTLessThanOrEqual(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
static Duration duration(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean equals(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 int getDays()
           
 int getHours()
           
 int getMinutes()
           
 int getMonths()
           
 double getSeconds()
           
 boolean getSigned()
           
 int getYears()
           
 Duration multiplyDTDuration(double dec)
           
 Duration multiplyYMDuration(double dec)
           
 void setDays(int days)
           
 void setHours(int hours)
           
 void setMinutes(int mts)
           
 void setMonths(int months)
           
 void setSeconds(double secs)
           
 void setYears(int years)
           
 Duration subtractDTDuration(Duration du)
           
 Duration subtractYMDuration(Duration d)
           
 java.lang.String toString()
           
static Duration YMDuration(java.lang.String duration)
          The duration function returns the duration specified in the duration string given as the argument..
static Duration YMDurationFromMonths(int months)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean YMEqual(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean YMGreaterThan(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean YMGreaterThanOrEqual(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean YMLessThan(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 boolean YMLessThanOrEqual(Duration du)
          The duration function returns the duration specified in the duration string given as the argument..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

du

public static final java.lang.String du
See Also:
Constant Field Values
Constructor Detail

Duration

public Duration(java.lang.String duration)
         throws javax.xml.transform.TransformerException
The duration string must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnD, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


Duration

public Duration(int[] xercesduration)
Added by JJK to support Xerces' stopgap internal representation as delivered through DTMSequence. We should work with them to converge on a shared time/date/duration object compatable with the schema spec.


Duration

public Duration(int year,
                int month,
                int day,
                int hour,
                int minute,
                double second)
Method Detail

duration

public static Duration duration(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


YMDuration

public static Duration YMDuration(java.lang.String duration)
                           throws javax.xml.transform.TransformerException
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMn, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.

Throws:
javax.xml.transform.TransformerException

YMDurationFromMonths

public static Duration YMDurationFromMonths(int months)
                                     throws javax.xml.transform.TransformerException
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMn, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.

Throws:
javax.xml.transform.TransformerException

DTDuration

public static Duration DTDuration(java.lang.String duration)
                           throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

DTDurationFromSecs

public static Duration DTDurationFromSecs(double secs)
                                   throws javax.xml.transform.TransformerException
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMn, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.

Throws:
javax.xml.transform.TransformerException

DTEqual

public boolean DTEqual(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


DTLessThan

public boolean DTLessThan(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


DTLessThanOrEqual

public boolean DTLessThanOrEqual(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


DTGreaterThan

public boolean DTGreaterThan(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


DTGreaterThanOrEqual

public boolean DTGreaterThanOrEqual(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


YMEqual

public boolean YMEqual(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


YMLessThan

public boolean YMLessThan(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


YMLessThanOrEqual

public boolean YMLessThanOrEqual(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


YMGreaterThan

public boolean YMGreaterThan(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


YMGreaterThanOrEqual

public boolean YMGreaterThanOrEqual(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


equals

public boolean equals(Duration du)
The duration function returns the duration specified in the duration string given as the argument.. The duration string that's returned must be a string in the format defined as the lexical representation of xs:duration in [3.2.6 duration] of [XML Schema Part 2: Datatypes]. The duration format is basically PnYnMnDTnHnMnS, although implementers should consult [XML Schema Part 2: Datatypes] and [ISO 8601] for details.


addYMDuration

public Duration addYMDuration(Duration d)
                       throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

subtractYMDuration

public Duration subtractYMDuration(Duration d)
                            throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

multiplyYMDuration

public Duration multiplyYMDuration(double dec)
                            throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

divideYMDuration

public Duration divideYMDuration(double dec)
                          throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

addDTDuration

public Duration addDTDuration(Duration du)
                       throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

subtractDTDuration

public Duration subtractDTDuration(Duration du)
                            throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

multiplyDTDuration

public Duration multiplyDTDuration(double dec)
                            throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

divideDTDuration

public Duration divideDTDuration(double dec)
                          throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

setYears

public void setYears(int years)

getYears

public int getYears()

setMonths

public void setMonths(int months)

getMonths

public int getMonths()

setDays

public void setDays(int days)

getDays

public int getDays()

setHours

public void setHours(int hours)

getHours

public int getHours()

setSeconds

public void setSeconds(double secs)

getSeconds

public double getSeconds()

setMinutes

public void setMinutes(int mts)

getMinutes

public int getMinutes()

getSigned

public boolean getSigned()

toString

public java.lang.String toString()


X-Smiles 1.2