public class Age extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
Age(Date birthday)
Instantiates a new Age object from the given Date objects.
|
Age(Date birthday,
Date till)
Instantiates a new Age object from the given Date objects.
|
Age(long elapsed)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
String |
getHumanReadableAge()
Gets a human readable string from the age.
|
String |
getHumanReadableAge(int[] readableAge)
Gets a human readable string from the age.
|
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
public Age(Date birthday)
birthday - The birthday.public Age(Date birthday, Date till)
birthday - The birthday.till - The point where the Age stops.public Age(long elapsed)
elapsed - The elapsed time in long.public double calculateInDays()
public double calculateInDays(long time)
time - the timepublic double calculateInDefaultMonth()
public double calculateInDefaultMonth(long time)
time - the time.public double calculateInHours()
public double calculateInHours(long time)
time - the timepublic double calculateInMinutes()
public double calculateInMinutes(long time)
time - the timepublic double calculateInSeconds()
public double calculateInSeconds(long time)
time - the timepublic double calculateInYears()
public double calculateInYears(long el)
el - The time.public int[] calculateInYearsMonthsDaysHoursMinutesAndSeconds()
public int[] calculateInYearsMonthsDaysHoursMinutesAndSeconds(long compute)
compute - The long to calculate.public String getHumanReadableAge()
public String getHumanReadableAge(int[] readableAge)
readableAge - The int array with the age values.Copyright © 2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.