Package org.apache.jena.datatypes.xsd
Class XSDDuration
- java.lang.Object
-
- org.apache.jena.datatypes.xsd.AbstractDateTime
-
- org.apache.jena.datatypes.xsd.XSDDuration
-
- All Implemented Interfaces:
java.lang.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.
-
-
Field Summary
-
Fields inherited from class org.apache.jena.datatypes.xsd.AbstractDateTime
EQUAL, GREATER_THAN, INDETERMINATE, LESS_THAN
-
-
Constructor Summary
Constructors Constructor Description XSDDuration(java.lang.Object value)
Constructor - should only be used by the internals but public scope because the internals spread across multiple packages.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Equality function (value based).java.math.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 durationint
getFullSeconds()
Return the number of full seconds in the durationint
getHours()
Return the number of hours in the durationint
getMinutes()
Return the number of minutes in the durationint
getMonths()
Return the number of months in the durationdouble
getSeconds()
Return the number of seconds in the duration, including fractional partdouble
getTimePart()
Return the time component of the duration - i.e.int
getYears()
Return the number of years in the durationint
hashCode()
java.lang.String
toString()
Serializer-
Methods inherited from class org.apache.jena.datatypes.xsd.AbstractDateTime
compare, compareTo, normalize
-
-
-
-
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 java.math.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 java.lang.String toString()
Serializer- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Equality function (value based).- Overrides:
equals
in classAbstractDateTime
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDateTime
-
-