|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.japaki.basic.Duration
public class Duration
An elapsed time in milliseconds. It facilitates the breakdown in
Constructor Summary | |
---|---|
Duration(int days,
int hours,
int minutes,
int seconds,
int millis)
Constructs a new duration. |
|
Duration(long millis)
Constructs a new duration. |
Method Summary | |
---|---|
Duration |
add(Duration other)
Add other to this object and return the sum. |
void |
addTo(Calendar calendar)
Add this duration to the calendar. |
void |
addTo(Date date)
Add this duration to the date. |
int |
compareTo(Duration other)
|
boolean |
equals(Object obj)
|
long |
getTimeInMillis()
Returns this duration's value in milliseconds. |
int |
hashCode()
|
Duration |
inverse()
Returns the inverse of this object. |
String |
toString()
Returns a string representation of this duration. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Duration(long millis)
millis
- The duration's value in milliseconds.
OutOfRangeException
- if the number of days is not in the
integer rangepublic Duration(int days, int hours, int minutes, int seconds, int millis)
Method Detail |
---|
public long getTimeInMillis()
public void addTo(Calendar calendar)
calendar
- summand and result of the sumpublic void addTo(Date date)
date
- summand and result of the sumpublic Duration add(Duration other)
Quasigroup
other
to this object and return the sum.
add
in interface Quasigroup<Duration>
other
- the other summand
public Duration inverse()
Quasigroup
inverse
in interface Quasigroup<Duration>
public int compareTo(Duration other)
compareTo
in interface Comparable<Duration>
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |