compare
public int compare(Object obj)
Return an integer for which of {# code this} or {#code obj} is larger.
Return 1 if this>obj
; 0 if this==obj
;
-1 if this;
-2 if this!=obj
otherwise (for example if either is NaN);
-3 if not comparable (incompatible types).
- compare in interface Quantity
equals
public boolean equals(Object obj)
Compare for equality.
Ignores unit.
- equals in interface Numeric
equals
public static boolean equals(Duration x,
Duration y)
Compare for equality.
Ignores unit.
getDays
public int getDays()
getHours
public int getHours()
getMinutes
public int getMinutes()
getMonths
public int getMonths()
getNanoSeconds
public long getNanoSeconds()
getNanoSecondsOnly
public int getNanoSecondsOnly()
getSecondsOnly
public int getSecondsOnly()
getTotalMinutes
public long getTotalMinutes()
getTotalMonths
public int getTotalMonths()
getTotalSeconds
public long getTotalSeconds()
getYears
public int getYears()
The number of years in the canonical representation.
hashCode
public int hashCode()
make
public static Duration make(int months,
long seconds,
int nanos,
Unit unit)
makeMinutes
public static Duration makeMinutes(int minutes)
makeMonths
public static Duration makeMonths(int months)
parseDayTimeDuration
public static Duration parseDayTimeDuration(String str)
parseDuration
public static Duration parseDuration(String str)
parseYearMonthDuration
public static Duration parseYearMonthDuration(String str)
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
valueOf
public static Duration valueOf(String str,
Unit unit)
Parse a duration lexical value as specified by XML Schama.
Return null if invalid syntax.
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException