Serializable
, Comparable<Month>
public enum Month extends Enum<Month>
Enum Constant | Description |
---|---|
APRIL |
|
AUGUST |
|
DECEMBER |
|
FEBRUARY |
|
JANUARY |
|
JULY |
|
JUNE |
|
MARCH |
|
MAY |
|
NOVEMBER |
|
OCTOBER |
|
SEPTEMBER |
Modifier and Type | Method | Description |
---|---|---|
static Month |
forStartOfQuarter(int quarter) |
Returns the starting month of a quarter.
|
static Month |
fromCalendar(Calendar calendar) |
|
static Month |
fromNumber(int number) |
|
int |
number() |
Returns the ISO 8601 number for this month.
|
int |
toCalendarMonth() |
Translate to Java Calender constant.
|
static Month |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static Month[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Month JANUARY
public static final Month FEBRUARY
public static final Month MARCH
public static final Month APRIL
public static final Month MAY
public static final Month JUNE
public static final Month JULY
public static final Month AUGUST
public static final Month SEPTEMBER
public static final Month OCTOBER
public static final Month NOVEMBER
public static final Month DECEMBER
public static Month[] values()
for (Month c : Month.values()) System.out.println(c);
public static Month valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int number()
public int toCalendarMonth()
public static Month fromNumber(int number)
number
- number of the month.number
:th month of the year, starting with 1 for January.public static Month forStartOfQuarter(int quarter)
quarter
- The number of the quarter, 1, 2, 3 or 4.Copyright © 2020 Apptus Technologies AB. All rights reserved.