org.deri.iris.terms.concrete
Class DayTimeDuration

java.lang.Object
  extended by org.deri.iris.terms.concrete.Duration
      extended by org.deri.iris.terms.concrete.DayTimeDuration
All Implemented Interfaces:
Comparable<ITerm>, IDayTimeDuration, IDuration, IConcreteTerm, ITerm

public class DayTimeDuration
extends Duration
implements IDayTimeDuration

An interface for representing the dayTimeDuration data-type. xs:dayTimeDuration is derived from xs:duration by restricting its lexical representation to contain only the days, hours, minutes and seconds components.

Example: _dayTimeDuration(1, 10, 31, 15.5) represents the duration of one day, 10 hours, 31 minutes and 15.5 seconds.

Remark: IRIS supports datatypes according to the standard specification for primitive XML Schema datatypes.

Author:
gigi

Method Summary
 URI getDatatypeIRI()
          Returns the fully qualified identifier for the data type corresponding to this term.
 IDayTimeDuration toCanonical()
          Returns a canonical representation of dayTimeDuration as defined in http://www.w3.org/TR/xpath-functions/#canonical-dayTimeDuration.
 String toCanonicalString()
          Shortened representation For negative durations, the canonical form is calculated using the absolute value of the duration and a negative sign is prepended to it.
 String toString()
           Returns a short string representation of this object.
 
Methods inherited from class org.deri.iris.terms.concrete.Duration
compareTo, equals, getDay, getDecimalSecond, getHour, getMillisecond, getMinute, getMonth, getSecond, getValue, getYear, hashCode, isGround, isPositive
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.deri.iris.api.terms.concrete.IDuration
getDay, getDecimalSecond, getHour, getMillisecond, getMinute, getMonth, getSecond, getValue, getYear, isPositive
 
Methods inherited from interface org.deri.iris.api.terms.ITerm
isGround
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

toCanonicalString

public String toCanonicalString()
Shortened representation For negative durations, the canonical form is calculated using the absolute value of the duration and a negative sign is prepended to it. If a component has the value zero (0) then the number and the designator for that component must be omitted. However, if all the components of the lexical form are zero (0), the canonical form is "PT0S". source: http://www.w3.org/TR/xpath-functions/#dt-dayTimeDuration

Specified by:
toCanonicalString in interface IConcreteTerm
Overrides:
toCanonicalString in class Duration
Returns:
A canonical string representation of this term.

getDatatypeIRI

public URI getDatatypeIRI()
Description copied from interface: IConcreteTerm
Returns the fully qualified identifier for the data type corresponding to this term. For instance, a terms representing a double data type should return the URI "http://www.w3.org/2001/XMLSchema#double".

Specified by:
getDatatypeIRI in interface IConcreteTerm
Overrides:
getDatatypeIRI in class Duration
Returns:
The fully qualified identifier for the data type corresponding to this term.

toCanonical

public IDayTimeDuration toCanonical()
Description copied from interface: IDayTimeDuration
Returns a canonical representation of dayTimeDuration as defined in http://www.w3.org/TR/xpath-functions/#canonical-dayTimeDuration.

Specified by:
toCanonical in interface IDayTimeDuration
Returns:
A canonical representation of this dayTimeDuration instance.

toString

public String toString()
Description copied from class: Duration

Returns a short string representation of this object. The format of the returned string is subject to change.

The resutl is formatted according to the XML 1.0 specification.

Overrides:
toString in class Duration
Returns:
the string representation