Package com.landawn.abacus.util
Enum CalendarUnit
- java.lang.Object
-
- java.lang.Enum<CalendarUnit>
-
- com.landawn.abacus.util.CalendarUnit
-
- All Implemented Interfaces:
Serializable
,Comparable<CalendarUnit>
public enum CalendarUnit extends Enum<CalendarUnit>
The Enum CalendarUnit.- Since:
- 0.8
- Author:
- Haiyang Li
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DAY
it has the same int value asCalendar.DAY_OF_MONTH
HOUR
it has the same int value asCalendar.HOUR_OF_DAY
MILLISECOND
it has the same int value asCalendar.MILLISECOND
MINUTE
it has the same int value asCalendar.MINUTE
MONTH
it has the same int value asCalendar.MONTH
SECOND
it has the same int value asCalendar.SECOND
WEEK
it has the same int value asCalendar.WEEK_OF_YEAR
YEAR
it has the same int value asCalendar.YEAR
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
intValue()
long
toMillis(long amount)
static CalendarUnit
valueOf(int intValue)
Returns the enum constant of this type with the specified name.static CalendarUnit
valueOf(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.
-
-
-
Enum Constant Detail
-
MILLISECOND
public static final CalendarUnit MILLISECOND
it has the same int value asCalendar.MILLISECOND
- See Also:
Calendar.MILLISECOND
-
SECOND
public static final CalendarUnit SECOND
it has the same int value asCalendar.SECOND
- See Also:
Calendar.SECOND
-
MINUTE
public static final CalendarUnit MINUTE
it has the same int value asCalendar.MINUTE
- See Also:
Calendar.MINUTE
-
HOUR
public static final CalendarUnit HOUR
it has the same int value asCalendar.HOUR_OF_DAY
- See Also:
Calendar.HOUR
-
DAY
public static final CalendarUnit DAY
it has the same int value asCalendar.DAY_OF_MONTH
- See Also:
Calendar.DAY_OF_MONTH
-
WEEK
public static final CalendarUnit WEEK
it has the same int value asCalendar.WEEK_OF_YEAR
- See Also:
Calendar.WEEK_OF_YEAR
-
MONTH
public static final CalendarUnit MONTH
it has the same int value asCalendar.MONTH
- See Also:
Calendar.MONTH
-
YEAR
public static final CalendarUnit YEAR
it has the same int value asCalendar.YEAR
- See Also:
Calendar.YEAR
-
-
Method Detail
-
values
public static CalendarUnit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CalendarUnit c : CalendarUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CalendarUnit valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
valueOf
public static CalendarUnit valueOf(int intValue)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
intValue
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
intValue
public int intValue()
- Returns:
-
toMillis
public long toMillis(long amount)
- Parameters:
amount
-- Returns:
-
-