|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.jonclark.util.TimeLength
public class TimeLength
| Constructor Summary | |
|---|---|
TimeLength(Date start,
Date end)
|
|
TimeLength(long millis)
|
|
TimeLength(long seconds,
long millis)
|
|
TimeLength(long minutes,
long seconds,
long millis)
|
|
TimeLength(long hours,
long minutes,
long seconds,
long millis)
|
|
TimeLength(long days,
long hours,
long minutes,
long seconds,
long millis)
|
|
| Method Summary | |
|---|---|
double |
getInDays()
|
double |
getInHours()
|
long |
getInMillis()
Note: This method is equivalent to toLong() |
double |
getInMinutes()
|
double |
getInSeconds()
|
double |
getInYears()
|
static void |
main(String[] args)
|
static TimeLength |
parseTimeLength(String strInput)
|
long |
toLong()
|
String |
toString()
Returns all unit components of the time length (including zero values). |
String |
toStringMultipleUnits(int nMaxUnits)
|
String |
toStringSingleUnit()
Finds the biggest unit possible that can be represented with a whole number and outputs a String in that unit of time length as a double to one decimal place of accuracy. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TimeLength(long millis)
millis - The length of this time span in milliseconds
public TimeLength(long seconds,
long millis)
public TimeLength(long minutes,
long seconds,
long millis)
public TimeLength(long hours,
long minutes,
long seconds,
long millis)
public TimeLength(long days,
long hours,
long minutes,
long seconds,
long millis)
public TimeLength(Date start,
Date end)
| Method Detail |
|---|
public double getInYears()
public double getInDays()
public double getInHours()
public double getInMinutes()
public double getInSeconds()
public long getInMillis()
toLong()
public long toLong()
public static TimeLength parseTimeLength(String strInput)
public String toStringSingleUnit()
double to one decimal place of accuracy.
e.g. 12.3 days or 2.5 minutes.
public String toStringMultipleUnits(int nMaxUnits)
public String toString()
e.g. 10 years, 0 days, 0 hours, 0 minutes, 29 seconds
toString in class Objectlong
values.
public static void main(String[] args)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||