Package org.orekit.time
Enum Class Month
- All Implemented Interfaces:
Serializable,Comparable<Month>,Constable
Enumerate representing a calendar month.
This enum is mainly useful to parse data files that use month names like Jan or JAN or January or numbers like 1 or 01. It handles month numbers as well as three letters abbreviation and full names, independently of capitalization.
- Author:
- Luc Maisonobe
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionGet the capitalized three letters abbreviation.Get the capitalized full name.Get the lower case three letters abbreviation.Get the lower case full name.static MonthgetMonth(int number) Get the month corresponding to a number.intGet the month number.Get the upper case three letters abbreviation.Get the upper case full name.static MonthparseMonth(String s) Parse the string to get the month.static MonthReturns the enum constant of this class with the specified name.static Month[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
JANUARY
January. -
FEBRUARY
February. -
MARCH
March. -
APRIL
April. -
MAY
May. -
JUNE
June. -
JULY
July. -
AUGUST
August. -
SEPTEMBER
September. -
OCTOBER
October. -
NOVEMBER
November. -
DECEMBER
December.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
getNumber
public int getNumber()Get the month number.- Returns:
- month number between 1 and 12
-
getUpperCaseName
Get the upper case full name.- Returns:
- upper case full name
-
getLowerCaseName
Get the lower case full name.- Returns:
- lower case full name
-
getCapitalizedName
Get the capitalized full name.- Returns:
- capitalized full name
-
getUpperCaseAbbreviation
Get the upper case three letters abbreviation.- Returns:
- upper case three letters abbreviation
-
getLowerCaseAbbreviation
Get the lower case three letters abbreviation.- Returns:
- lower case three letters abbreviation
-
getCapitalizedAbbreviation
Get the capitalized three letters abbreviation.- Returns:
- capitalized three letters abbreviation
-
parseMonth
Parse the string to get the month.The string can be either the month number, the full name or the three letter abbreviation. The parsing ignore the case of the specified string and trims surrounding blanks.
- Parameters:
s- string to parse- Returns:
- the month corresponding to the string
- Throws:
IllegalArgumentException- if the string does not correspond to a month
-
getMonth
Get the month corresponding to a number.- Parameters:
number- month number- Returns:
- the month corresponding to the string
- Throws:
IllegalArgumentException- if the string does not correspond to a month
-