|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jaulp.date.Age
public class Age
Helper class to present one long value from a calculate two Dates in a human readable string.
| Field Summary | |
|---|---|
static long |
ONE_DAY
The Constant ONE_DAY. |
static long |
ONE_DEFAULT_MONTH
The Constant ONE_DEFAULT_MONTH. |
static long |
ONE_HOUR
The Constant ONE_HOUR. |
static long |
ONE_MINUTE
The Constant ONE_MINUTE. |
static long |
ONE_SECOND
The Constant ONE_SECOND. |
static long |
ONE_YEAR
The Constant ONE_YEAR. |
| Constructor Summary | |
|---|---|
Age(java.util.Date birthday)
Instantiates a new Age object from the given Date objects. |
|
Age(java.util.Date birthday,
java.util.Date till)
Instantiates a new Age object from the given Date objects. |
|
Age(long elapsed)
Default constructor. |
|
| Method Summary | |
|---|---|
double |
calculateInDays()
Calculate in days. |
double |
calculateInDays(long time)
Calculate in days. |
double |
calculateInDefaultMonth()
Calculate in default month. |
double |
calculateInDefaultMonth(long time)
Calculate in default month. |
double |
calculateInHours()
Calculate in hours. |
double |
calculateInHours(long time)
Calculate in hours. |
double |
calculateInMinutes()
Calculate in minutes. |
double |
calculateInMinutes(long time)
Calculate in minutes. |
double |
calculateInSeconds()
Calculate in seconds. |
double |
calculateInSeconds(long time)
Calculate in minutes. |
double |
calculateInYears()
Calculate in years. |
double |
calculateInYears(long el)
Calculate in years. |
int[] |
calculateInYearsMonthsDaysHoursMinutesAndSeconds()
Calculate in years months days hours minutes and seconds. |
int[] |
calculateInYearsMonthsDaysHoursMinutesAndSeconds(long compute)
Calculate in years months days hours minutes and seconds. |
java.lang.String |
getHumanReadableAge()
Gets a human readable string from the age. |
java.lang.String |
getHumanReadableAge(int[] readableAge)
Gets a human readable string from the age. |
java.lang.String |
printHumanReadableAge()
Deprecated. Use instead the method Age.getHumanReadableAge(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long ONE_SECOND
public static final long ONE_MINUTE
public static final long ONE_HOUR
public static final long ONE_DAY
public static final long ONE_DEFAULT_MONTH
public static final long ONE_YEAR
| Constructor Detail |
|---|
public Age(java.util.Date birthday)
birthday - The birthday.
public Age(java.util.Date birthday,
java.util.Date till)
birthday - The birthday.till - The point where the Age stops.public Age(long elapsed)
elapsed - The elapsed time in long.| Method Detail |
|---|
public double calculateInDays()
public double calculateInDays(long time)
time - the time
public double calculateInDefaultMonth()
public double calculateInDefaultMonth(long time)
time - the time.
public double calculateInHours()
public double calculateInHours(long time)
time - the time
public double calculateInMinutes()
public double calculateInMinutes(long time)
time - the time
public double calculateInSeconds()
public double calculateInSeconds(long time)
time - the time
public double calculateInYears()
public double calculateInYears(long el)
el - The time.
public int[] calculateInYearsMonthsDaysHoursMinutesAndSeconds()
public int[] calculateInYearsMonthsDaysHoursMinutesAndSeconds(long compute)
compute - The long to calculate.
public java.lang.String getHumanReadableAge()
public java.lang.String getHumanReadableAge(int[] readableAge)
readableAge - The int array with the age values.
@Deprecated public java.lang.String printHumanReadableAge()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||