Package gnu.math
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 gnu.math.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 gnu.math.Numeric
add, asNumericOrNull, div_inv, floatValue, geq, grt, intValue, longValue, mul_ident, power, sub, toExact, toInexactMethods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
unit
-
-
Constructor Details
-
Duration
public Duration()
-
-
Method Details
-
make
-
makeMonths
-
makeMinutes
-
parse
-
parseDuration
-
parseYearMonthDuration
-
parseDayTimeDuration
-
valueOf
Parse a duration lexical value as specified by XML Schama. Return null if invalid syntax. -
add
Description copied from class:NumericReturn this + k * obj. -
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
public boolean isZero() -
isExact
public boolean isExact() -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
unit
-
number
-
hashCode
public int hashCode() -
equals
Compare for equality. Ignores unit. -
equals
Compare for equality. Ignores unit.
-