java.lang.Object
org.apache.jena.datatypes.xsd.AbstractDateTime
org.apache.jena.datatypes.xsd.XSDDuration
- All Implemented Interfaces:
Comparable<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
ConstructorsConstructorDescriptionXSDDuration(Object value) Constructor - should only be used by the internals but public scope because the internals spread across multiple packages. -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquality function (value based).Return the number of seconds in the duration, including the fractional part, in a lossless but expensive notation - i.e. a BigDecimal.intgetDays()Return the number of years in the durationintReturn the number of full seconds in the durationintgetHours()Return the number of hours in the durationintReturn the number of minutes in the durationintReturn the number of months in the durationdoubleReturn the number of seconds in the duration, including fractional partdoubleReturn the time component of the duration - i.e. just the hours/mins/seconds, and returns the values in seconds.intgetYears()Return the number of years in the durationinthashCode()toString()SerializerMethods inherited from class org.apache.jena.datatypes.xsd.AbstractDateTime
compare, compareTo, normalize
-
Constructor Details
-
XSDDuration
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 Details
-
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
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
Serializer -
equals
Equality function (value based).- Overrides:
equalsin classAbstractDateTime
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractDateTime
-