Interface Duration
- All Superinterfaces:
Comparable<Duration>, Duration, OsidPrimitive, OsidPrimitive, Serializable
The Duration a length of time.
While a DateTime represents a point on a calendar and a tick
on a clock, a Duration represents a measurement. Each of these
methods returns the total absolute measurement in the specified units.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if uncertainty is defined for this time.getAeons()Gets the number of aeons.Gets the number of attoseconds.Gets the number of blue moons.Gets the calendar type.Gets the number of centuries.getDays()Gets the number of days.Gets the number of epochs.Gets the number of femtoseconds.Gets the granularity of this duration.longIf the granularity of the time equalsgetGranularity(), then the multiplier is 1.getHours()Gets the number of hours.Gets the number of microseconds.Gets the number of millennia.Gets the number of milliseconds.Gets the number of minutes.Gets the number of months.Gets the number of nanoseconds.Gets the number of picoseconds.Gets the number of Planck sseconds.Gets the number of scores.Gets the number of seconds.Gets the time type.longGets the uncertainty of this time in the negative direction.longGets the uncertainty of this time in the positive direction.Gets the units of the uncertainty.Gets the number of undaseconds.Gets the number of vatoseconds.Gets the number of weebleseconds.getWeeks()Gets the number of weeks.Gets the number of xoxxoseconds.getYears()Gets the number of years.Gets the number of yoctoseconds.Gets the number of zeptoseconds.Methods inherited from interface Duration
compareTo, equals, getLowerBound, getUpperBound, hashCode, isExclusive, isGreater, isInclusive, isLessModifier and TypeMethodDescriptionintCompares this duration with the specifiedDurationto determine the natural order.booleanDetermines if the givenDurationis equal to this one.Gets the lower bound of the duration.Gets the upper bound of the duration.inthashCode()Returns a hash code value for thisDurationbased on the types, values, granularity, and uncertainties.booleanisExclusive(Duration duration) Tests if the range of this Duration, as specified by its granularity and uncertainty, does not overlap the given Duration.booleanTests if this Duration is greater than the given Duration.booleanisInclusive(Duration duration) Tests if the range of this Duration, as specified by its granularity and uncertainty, includes the given Duration ranged by its grabularity and uncertainty.booleanTests if this Duration is less than the given Duration.Methods inherited from interface OsidPrimitive
toString
-
Method Details
-
getCalendarType
Type getCalendarType()Gets the calendar type.- Returns:
- the calendar type
- Compliance:
mandatory- This method must be implemented.
-
getTimeType
Type getTimeType()Gets the time type.- Returns:
- the time type
- Compliance:
mandatory- This method must be implemented.
-
getAeons
BigDecimal getAeons()Gets the number of aeons. An aeon is 1B years.- Returns:
- the number of aeons
- Compliance:
mandatory- This method must be implemented.
-
getEpochs
BigDecimal getEpochs()Gets the number of epochs. An epoch is 1M years.- Returns:
- the number of epochs
- Compliance:
mandatory- This method must be implemented.
-
getMillennia
BigDecimal getMillennia()Gets the number of millennia. A millennium is 1,000 years.- Returns:
- the number of millennia
- Compliance:
mandatory- This method must be implemented.
-
getCenturies
BigDecimal getCenturies()Gets the number of centuries.- Returns:
- the number of centuries
- Compliance:
mandatory- This method must be implemented.
-
getScores
BigDecimal getScores()Gets the number of scores.- Returns:
- the number of scores
- Compliance:
mandatory- This method must be implemented.
-
getBluemoons
BigDecimal getBluemoons()Gets the number of blue moons.- Returns:
- the number of blue moons
- Compliance:
mandatory- This method must be implemented.
-
getYears
BigDecimal getYears()Gets the number of years.- Returns:
- the number of years
- Compliance:
mandatory- This method must be implemented.
-
getMonths
BigDecimal getMonths()Gets the number of months.- Returns:
- the number of months
- Compliance:
mandatory- This method must be implemented.
-
getWeeks
BigDecimal getWeeks()Gets the number of weeks.- Returns:
- the number of weeks
- Compliance:
mandatory- This method must be implemented.
-
getDays
BigDecimal getDays()Gets the number of days.- Returns:
- the number of days
- Compliance:
mandatory- This method must be implemented.
-
getHours
BigDecimal getHours()Gets the number of hours.- Returns:
- the number of hours
- Compliance:
mandatory- This method must be implemented.
-
getMinutes
BigDecimal getMinutes()Gets the number of minutes.- Returns:
- the number of minutes
- Compliance:
mandatory- This method must be implemented.
-
getSeconds
BigDecimal getSeconds()Gets the number of seconds.- Returns:
- the number of seconds
- Compliance:
mandatory- This method must be implemented.
-
getMilliseconds
BigDecimal getMilliseconds()Gets the number of milliseconds. A millisecond is one thousandth of a second.- Returns:
- the number of milliseconds
- Compliance:
mandatory- This method must be implemented.
-
getMicroseconds
BigDecimal getMicroseconds()Gets the number of microseconds. A microsecond is one millionth of a second.- Returns:
- the number of micrseconds
- Compliance:
mandatory- This method must be implemented.
-
getNanoseconds
BigDecimal getNanoseconds()Gets the number of nanoseconds. A nanosecond is one billionth of a second.- Returns:
- the number of nanoseconds
- Compliance:
mandatory- This method must be implemented.
-
getPicoseconds
BigDecimal getPicoseconds()Gets the number of picoseconds. A picosecond is one trillionth of a second.- Returns:
- the number of picoseconds
- Compliance:
mandatory- This method must be implemented.
-
getFemtoseconds
BigDecimal getFemtoseconds()Gets the number of femtoseconds. A femtosecond is one quadrillionth of a second.- Returns:
- the number of femtoseconds
- Compliance:
mandatory- This method must be implemented.
-
getAttoseconds
BigDecimal getAttoseconds()Gets the number of attoseconds. An attosecond is one quintillionth of a second.- Returns:
- the number of attoseconds
- Compliance:
mandatory- This method must be implemented.
-
getZeptoseconds
BigDecimal getZeptoseconds()Gets the number of zeptoseconds. A zeptosecond is one sextillionth of a second.- Returns:
- the number of zeptoseconds
- Compliance:
mandatory- This method must be implemented.
-
getYoctoseconds
BigDecimal getYoctoseconds()Gets the number of yoctoseconds. A yoctosecond is one septillionth of a second. This is getting quite small.- Returns:
- the number of yoctoseconds
- Compliance:
mandatory- This method must be implemented.
-
getXoxxoseconds
BigDecimal getXoxxoseconds()Gets the number of xoxxoseconds. A xoxxosecond is one octillionth of a second. We're going with Rudy Rucker here.- Returns:
- the number of xoxxoseconds
- Compliance:
mandatory- This method must be implemented.
-
getWeebleseconds
BigDecimal getWeebleseconds()Gets the number of weebleseconds. A weeblesecond is one nonillionth of a second.- Returns:
- the number of weebleseconds
- Compliance:
mandatory- This method must be implemented.
-
getVatoseconds
BigDecimal getVatoseconds()Gets the number of vatoseconds. A vatosecond is one decillionth of a second.- Returns:
- the number of vatoseconds
- Compliance:
mandatory- This method must be implemented.
-
getUndaseconds
BigDecimal getUndaseconds()Gets the number of undaseconds. An undasecond is one unadecillionth of a second.- Returns:
- the number of undaseconds
- Compliance:
mandatory- This method must be implemented.
-
getPlanckSeconds
BigDecimal getPlanckSeconds()Gets the number of Planck sseconds. A Planck is 10 quattuordecillionths of a second.- Returns:
- the number of planck seconds
- Compliance:
mandatory- This method must be implemented.
-
getGranularity
DateTimeResolution getGranularity()Gets the granularity of this duration. The granularity indicates the resolution of the clock. More precision than what is specified in this method cannot be inferred from the available data.- Returns:
- the time units
- Compliance:
mandatory- This method must be implemented.
-
getGranularityMultiplier
long getGranularityMultiplier()If the granularity of the time equalsgetGranularity(), then the multiplier is 1. This method may return a different number when the granularity differs from one of the defined resolutions.- Returns:
- granularity multiplier
- Compliance:
mandatory- This method must be implemented.
-
definesUncertainty
boolean definesUncertainty()Tests if uncertainty is defined for this time.- Returns:
trueif uncertainty is defined,falseotherwise- Compliance:
mandatory- This method must be implemented.
-
getUncertaintyUnits
DateTimeResolution getUncertaintyUnits()Gets the units of the uncertainty.- Returns:
- units of the uncertainty
- Throws:
IllegalStateException-definesUncertainty()isfalse- Compliance:
mandatory- This method must be implemented.
-
getUncertaintyMinus
long getUncertaintyMinus()Gets the uncertainty of this time in the negative direction.- Returns:
- the uncertainty under this value
- Throws:
IllegalStateException-definesUncertainty()isfalse- Compliance:
mandatory- This method must be implemented.
-
getUncertaintyPlus
long getUncertaintyPlus()Gets the uncertainty of this time in the positive direction.- Returns:
- the uncertainty over this value
- Throws:
IllegalStateException-definesUncertainty()isfalse- Compliance:
mandatory- This method must be implemented.
-