public class Duration extends Quantity implements java.io.Externalizable
| Constructor and Description |
|---|
Duration() |
| Modifier and Type | Method and Description |
|---|---|
static Duration |
add(Duration x,
Duration y,
int k) |
Numeric |
add(java.lang.Object y,
int k)
Return this + k * obj.
|
static int |
compare(Duration x,
Duration y) |
int |
compare(java.lang.Object obj)
Return an integer for which of
this or obj is larger. |
static double |
div(Duration dur1,
Duration dur2) |
Numeric |
div(java.lang.Object y) |
static boolean |
equals(Duration x,
Duration y)
Compare for equality.
|
boolean |
equals(java.lang.Object obj)
Compare for equality.
|
int |
getDays() |
int |
getHours() |
int |
getMinutes() |
int |
getMonths() |
long |
getNanoSeconds() |
int |
getNanoSecondsOnly() |
int |
getSecondsOnly() |
long |
getTotalMinutes() |
int |
getTotalMonths() |
long |
getTotalSeconds() |
int |
getYears()
The number of years in the canonical representation.
|
int |
hashCode() |
boolean |
isExact() |
boolean |
isZero() |
static Duration |
make(int months,
long seconds,
int nanos,
Unit unit) |
static Duration |
makeMinutes(int minutes) |
static Duration |
makeMonths(int months) |
Numeric |
mul(java.lang.Object y) |
Numeric |
mulReversed(Numeric x) |
Complex |
number() |
static Duration |
parse(java.lang.String str,
Unit unit) |
static Duration |
parseDayTimeDuration(java.lang.String str) |
static Duration |
parseDuration(java.lang.String str) |
static Duration |
parseYearMonthDuration(java.lang.String str) |
void |
readExternal(java.io.ObjectInput in) |
static Duration |
times(Duration x,
double y) |
java.lang.String |
toString() |
Unit |
unit() |
static Duration |
valueOf(java.lang.String str,
Unit unit)
Parse a duration lexical value as specified by XML Schama.
|
void |
writeExternal(java.io.ObjectOutput out) |
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, toStringpublic Unit unit
public static Duration makeMonths(int months)
public static Duration makeMinutes(int minutes)
public static Duration parseDuration(java.lang.String str)
public static Duration parseYearMonthDuration(java.lang.String str)
public static Duration parseDayTimeDuration(java.lang.String str)
public static Duration valueOf(java.lang.String str, Unit unit)
public Numeric add(java.lang.Object y, int k)
Numericpublic Numeric mulReversed(Numeric x)
mulReversed in class Quantitypublic int compare(java.lang.Object obj)
Numericthis or obj is larger.
Return 1 if this>obj; 0 if this==obj;
-1 if this<obj;
-2 if this!=obj otherwise (for example if either is NaN);
-3 if not comparable (incompatible types).public int getYears()
public int getMonths()
public int getDays()
public int getHours()
public int getMinutes()
public int getSecondsOnly()
public int getNanoSecondsOnly()
public int getTotalMonths()
public long getTotalSeconds()
public long getTotalMinutes()
public long getNanoSeconds()
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic int hashCode()
hashCode in class java.lang.Object