com.hp.hpl.jena.datatypes.xsd
Class XSDDuration

java.lang.Object
  extended by com.hp.hpl.jena.datatypes.xsd.AbstractDateTime
      extended by com.hp.hpl.jena.datatypes.xsd.XSDDuration
All Implemented Interfaces:
Comparable<AbstractDateTime>

public class XSDDuration
extends AbstractDateTime

Represent an XSD duration value. We use a seven dimensional space with years, months, days, hours, minutes, seconds and fractional seconds. This deviates from the spec which allows arbitrary position decimals for seconds.

Version:
$Revision: 1.2 $ on $Date: 2010-05-09 10:22:07 $
Author:
Dave Reynolds

Field Summary
 
Fields inherited from class com.hp.hpl.jena.datatypes.xsd.AbstractDateTime
EQUAL, GREATER_THAN, INDETERMINATE, LESS_THAN
 
Constructor Summary
XSDDuration(Object value)
          Constructor - should only be used by the internals but public scope because the internals spread across multiple packages.
 
Method Summary
 BigDecimal getBigSeconds()
          Return the number of seconds in the duration, including the fractional part, in a lossless but expensive notation - i.e.
 int getDays()
          Return the number of years in the duration
 int getFullSeconds()
          Return the number of full seconds in the duration
 int getHours()
          Return the number of hours in the duration
 int getMinutes()
          Return the number of minutes in the duration
 int getMonths()
          Return the number of months in the duration
 double getSeconds()
          Return the number of seconds in the duration, including fractional part
 double getTimePart()
          Return the time component of the duration - i.e.
 int getYears()
          Return the number of years in the duration
 String toString()
          Serializer
 
Methods inherited from class com.hp.hpl.jena.datatypes.xsd.AbstractDateTime
compare, compareTo, equals, hashCode, normalize
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XSDDuration

public XSDDuration(Object value)
Constructor - should only be used by the internals but public scope because the internals spread across multiple packages.

Parameters:
value - the date/time value returned by the parsing
Method Detail

getYears

public int getYears()
Return the number of years in the duration


getMonths

public int getMonths()
Return the number of months in the duration


getDays

public int getDays()
Return the number of years in the duration


getHours

public int getHours()
Return the number of hours in the duration


getMinutes

public int getMinutes()
Return the number of minutes in the duration


getFullSeconds

public int getFullSeconds()
Return the number of full seconds in the duration


getSeconds

public double getSeconds()
Return the number of seconds in the duration, including fractional part


getBigSeconds

public BigDecimal getBigSeconds()
Return the number of seconds in the duration, including the fractional part, in a lossless but expensive notation - i.e. a BigDecimal.


getTimePart

public double getTimePart()
Return the time component of the duration - i.e. just the hours/mins/seconds, and returns the values in seconds.


toString

public String toString()
Serializer

Overrides:
toString in class Object


Licenced under the Apache License, Version 2.0