org.deri.iris.terms.concrete
Class YearMonthDuration

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

public class YearMonthDuration
extends Duration
implements IYearMonthDuration

An interface for representing the xs:yearMonthDuration data-type. xs:yearMonthDuration is derived from xs:duration by restricting its lexical representation to contain only the year and month components.

Example: _yearMonthDuration(1, 6) represents the duration of one and a half years.

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.
 YearMonthDuration toCanonical()
          The canonical representation of yearMonthDuration as defined in http://www.w3.org/TR/xpath-functions/#canonical-yearMonthDuration.
 String toCanonicalString()
          Shortened representation The xs:yearMonthDuration type represents a restriction of the xs:duration type, with only year (Y) and month (M) components allowed.
 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

toCanonical

public YearMonthDuration toCanonical()
The canonical representation of yearMonthDuration as defined in http://www.w3.org/TR/xpath-functions/#canonical-yearMonthDuration.

Specified by:
toCanonical in interface IYearMonthDuration
Returns:
A canonical representation of this yearMonthDuration instance.

toCanonicalString

public String toCanonicalString()
Shortened representation The xs:yearMonthDuration type represents a restriction of the xs:duration type, with only year (Y) and month (M) components allowed. Its lexical representation is PnYnM, where an uppercase P starts the expression, and n indicates the quantity of each component. For example, the value P3Y5M represents a period of three years and five months. You can omit components whose quantity is zero, but at least one component is required. All of the lexical rules for xs:duration also apply to the xs:yearMonthDuration type. This includes allowing a negative sign at the beginning of the value. source: http://my.safaribooksonline.com/0596006349/orm9780596006341-APP-B-SECT-50

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.

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