@Status(stage=PRODUCTION, unitTests=PARTIAL) @Review(by="Kees Schotanus", at="2009-09-28") public enum Month extends Enum<Month> implements LocalizableEnumeration
Enum Constant and Description |
---|
APRIL
April.
|
AUGUST
August.
|
DECEMBER
December.
|
FEBRUARY
February.
|
JANUARY
January.
|
JULY
July.
|
JUNE
June.
|
MARCH
March.
|
MAY
May.
|
NOVEMBER
November.
|
OCTOBER
October.
|
SEPTEMBER
September.
|
Modifier and Type | Field and Description |
---|---|
static int |
MONTHS_IN_A_YEAR
The number of months in a year.
|
Modifier and Type | Method and Description |
---|---|
Serializable |
getCode()
Gets the code of this Month.
|
CodeDescription |
getCodeDescription(Locale locale)
Gets the CodeDescription of this Month.
|
static List<CodeDescription> |
getCodeDescriptions(Locale locale)
Gets a List of
CodeDescription objects for all the Months. |
String |
getDescription(Locale locale)
Gets the localized description of this Month.
|
int |
getMaximumNumberOfDays()
Gets the maximum number of days of this Month.
|
int |
getNumber()
Gets the one based number of this Month.
|
String |
toLocalizedShortString(Locale locale)
Creates a localized short String representation of this Month.
|
String |
toLocalizedString(Locale locale)
Creates a localized String representation of this Month.
|
static Month |
valueOf(int month)
Gets the Month corresponding to the supplied integer month.
|
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 final int MONTHS_IN_A_YEAR
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 getNumber()
Enum.ordinal()
since these methods use a zero (for January) based month.public int getMaximumNumberOfDays()
public static Month valueOf(int month)
month
- The integer month from 1 to 12.IllegalArgumentException
- When no Month exists that corresponds to
the supplied month.
public String toLocalizedString(Locale locale)
locale
- Locale to localize this Month.
public String toLocalizedShortString(Locale locale)
locale
- Locale to localize this Month.
public Serializable getCode()
getCode
in interface LocalizableEnumeration
public String getDescription(Locale locale)
getDescription
in interface Localizable
getDescription
in interface LocalizableEnumeration
locale
- Locale used to localize the description.
toLocalizedString(Locale)
public CodeDescription getCodeDescription(Locale locale)
getCodeDescription
in interface LocalizableEnumeration
locale
- Locale used to localize the description.
public static List<CodeDescription> getCodeDescriptions(Locale locale)
CodeDescription
objects for all the Months.locale
- Locale used to localize the descriptions.
CodeDescription
objects for all the Months.Copyright © 2008–2018. All rights reserved.