public enum CalendarUnit extends java.lang.Enum<CalendarUnit>
Enum Constant and Description |
---|
DAY
it has the same int value as
Calendar.DAY_OF_MONTH |
HOUR
it has the same int value as
Calendar.HOUR_OF_DAY |
MILLISECOND
it has the same int value as
Calendar.MILLISECOND |
MINUTE
it has the same int value as
Calendar.MINUTE |
MONTH
it has the same int value as
Calendar.MONTH |
SECOND
it has the same int value as
Calendar.SECOND |
WEEK
it has the same int value as
Calendar.WEEK_OF_YEAR |
YEAR
it has the same int value as
Calendar.YEAR |
Modifier and Type | Method and Description |
---|---|
int |
intValue() |
long |
toMillis(long amount) |
static CalendarUnit |
valueOf(int intValue) |
static CalendarUnit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CalendarUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CalendarUnit MILLISECOND
Calendar.MILLISECOND
Calendar.MILLISECOND
public static final CalendarUnit SECOND
Calendar.SECOND
Calendar.SECOND
public static final CalendarUnit MINUTE
Calendar.MINUTE
Calendar.MINUTE
public static final CalendarUnit HOUR
Calendar.HOUR_OF_DAY
Calendar.HOUR
public static final CalendarUnit DAY
Calendar.DAY_OF_MONTH
Calendar.DAY_OF_MONTH
public static final CalendarUnit WEEK
Calendar.WEEK_OF_YEAR
Calendar.WEEK_OF_YEAR
public static final CalendarUnit MONTH
Calendar.MONTH
Calendar.MONTH
public static final CalendarUnit YEAR
Calendar.YEAR
Calendar.YEAR
public static CalendarUnit[] values()
for (CalendarUnit c : CalendarUnit.values()) System.out.println(c);
public static CalendarUnit 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 static CalendarUnit valueOf(int intValue)
public int intValue()
public long toMillis(long amount)