Class Duration
java.lang.Object
java.lang.Number
gnu.math.Numeric
gnu.math.Quantity
gnu.math.Duration
- All Implemented Interfaces:
Externalizable, Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DurationReturn this + k * obj.static intintReturn an integer for which ofthisorobjis larger.static doublestatic booleanCompare for equality.booleanCompare for equality.intgetDays()intgetHours()intintlongintintlongintlongintgetYears()The number of years in the canonical representation.inthashCode()booleanisExact()booleanisZero()static Durationstatic DurationmakeMinutes(int minutes) static DurationmakeMonths(int months) number()static Durationstatic Durationstatic DurationparseDuration(String str) static Durationvoidstatic DurationtoString()unit()static DurationParse a duration lexical value as specified by XML Schama.voidMethods inherited from class Quantity
abs, add, addReversed, compare, compareReversed, dimensions, divide, divReversed, doubleImagValue, doubleJmagValue, doubleKmagValue, doubleValue, im, imValue, jm, jmValue, km, kmValue, make, make, make, neg, re, reValue, times, toStringMethods inherited from class Numeric
add, asNumericOrNull, div_inv, floatValue, geq, grt, intValue, longValue, mul_ident, power, sub, toExact, toInexactMethods inherited from class Number
byteValue, shortValue
-
Field Details
-
unit
-
-
Constructor Details
-
Duration
public Duration()
-
-
Method Details
-
make
-
makeMonths
-
makeMinutes
-
parse
-
parseDuration
-
parseYearMonthDuration
-
parseDayTimeDuration
-
valueOf
-
add
-
mul
-
mulReversed
- Overrides:
mulReversedin classQuantity
-
div
-
div
-
add
-
times
-
compare
-
compare
Description copied from class:NumericReturn an integer for which ofthisorobjis larger. Return 1 ifthis>obj; 0 ifthis==obj; -1 ifthis<obj; -2 ifthis!=objotherwise (for example if either is NaN); -3 if not comparable (incompatible types). -
toString
-
getYears
public int getYears()The number of years in the canonical representation. -
getMonths
public int getMonths() -
getDays
public int getDays() -
getHours
public int getHours() -
getMinutes
public int getMinutes() -
getSecondsOnly
public int getSecondsOnly() -
getNanoSecondsOnly
public int getNanoSecondsOnly() -
getTotalMonths
public int getTotalMonths() -
getTotalSeconds
public long getTotalSeconds() -
getTotalMinutes
public long getTotalMinutes() -
getNanoSeconds
public long getNanoSeconds() -
isZero
-
isExact
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
unit
-
number
-
hashCode
-
equals
-
equals
-