Enum Month
- All Implemented Interfaces:
Comparable<Month>, TemporalAccessor
The twelve months of the ISO calendar.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionApril, month 4.August, month 8.December, month 12.February, month 2.January, month 1.July, month 7.June, month 6.March, month 3.May, month 5.November, month 11.October, month 10.September, month 9. -
Method Summary
Modifier and TypeMethodDescriptionintfirstDayOfYear(boolean leapYear) The day of the year this month starts on, 1 for January.The first month of the quarter this month is in.intgetValue()1 for January to 12 for December.intlength(boolean leapYear) The number of days of this month in a leap year or another.intThe most days this month can have.intThe fewest days this month can have.minus(long months) The monthmonthsearlier, around the year.static Monthof(int month) The month numberedmonth, 1 for January to 12 for December.plus(long months) The monthmonthslater, around the year.static MonthReturns 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.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
JANUARY
January, month 1. -
FEBRUARY
February, month 2. -
MARCH
March, month 3. -
APRIL
April, month 4. -
MAY
May, month 5. -
JUNE
June, month 6. -
JULY
July, month 7. -
AUGUST
August, month 8. -
SEPTEMBER
September, month 9. -
OCTOBER
October, month 10. -
NOVEMBER
November, month 11. -
DECEMBER
December, month 12.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
of
The month numberedmonth, 1 for January to 12 for December. -
getValue
public int getValue()1 for January to 12 for December. -
plus
The monthmonthslater, around the year. -
minus
The monthmonthsearlier, around the year. -
length
public int length(boolean leapYear) The number of days of this month in a leap year or another. -
minLength
public int minLength()The fewest days this month can have. -
maxLength
public int maxLength()The most days this month can have. -
firstDayOfYear
public int firstDayOfYear(boolean leapYear) The day of the year this month starts on, 1 for January. -
firstMonthOfQuarter
The first month of the quarter this month is in.
-