|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.dtt.ca.util.Duration
public class Duration
This class represent the duration of a period of time and it could be used to convert the length of the period in several units of time.
Constructor Summary | |
---|---|
Duration(int hours,
int minutes,
int seconds,
int millis)
Creates an instance of Duration representing the length of a period of time. |
|
Duration(long millis)
Creates an instance of Duration representing the length of a period of time. |
Method Summary | |
---|---|
static Duration |
getDuration(java.util.Date startTime,
java.util.Date endTime)
Calculates the time duration between a start time and an end time. |
long |
toMillis()
Convert the total value in milliseconds. |
long |
toMinutes()
Convert the total value in minutes. |
long |
toSeconds()
Convert the total value in seconds. |
java.lang.String |
toString()
Retrieves the duration as a String object formatted as "hh:mm:ss:lll". |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Duration(long millis)
millis
- the initial value in milliseconds.public Duration(int hours, int minutes, int seconds, int millis)
hours
- initial value for hours.minutes
- initial value for minutes.seconds
- initial value for seconds.millis
- initial value for milliseconds.Method Detail |
---|
public long toMillis()
public long toSeconds()
public long toMinutes()
public java.lang.String toString()
toString
in class java.lang.Object
public static Duration getDuration(java.util.Date startTime, java.util.Date endTime)
startTime
- the start time.endTime
- the end time.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |