Enum Constant and Description |
---|
DAY |
HOUR |
MIN |
MONTH |
MS |
SEC |
WEEK |
YEAR |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
after(java.util.Date date,
int amount) |
java.util.Date |
before(java.util.Date date,
int amount) |
static double |
fromMillis(long millis,
TimeUnits destUnits) |
int |
getCalendarField() |
long |
getMilliMultiplier() |
static long |
toMillis(java.lang.Double time,
TimeUnits units) |
static TimeUnits |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static TimeUnits[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TimeUnits MS
public static final TimeUnits SEC
public static final TimeUnits MIN
public static final TimeUnits HOUR
public static final TimeUnits DAY
public static final TimeUnits WEEK
public static final TimeUnits MONTH
public static final TimeUnits YEAR
public static TimeUnits[] values()
for (TimeUnits c : TimeUnits.values()) System.out.println(c);
public static TimeUnits valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic long getMilliMultiplier()
public static long toMillis(java.lang.Double time, TimeUnits units)
public static double fromMillis(long millis, TimeUnits destUnits)
public int getCalendarField()
public java.util.Date before(java.util.Date date, int amount)
public java.util.Date after(java.util.Date date, int amount)