Enum Class IndianMonth
- All Implemented Interfaces:
Serializable
,Comparable<IndianMonth>
,java.lang.constant.Constable
,Predicate<IndianCalendar>
,ChronoCondition<IndianCalendar>
The Indian national calendar defines 12 indian months.
- Since:
- 3.32/4.27
- Author:
- Meno Hochschild
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionThe 9th month of Indian national calendar with 30 days (starts on 22nd of November).The 4th month of Indian national calendar with 31 days (starts on 22nd of June).The 7th month of Indian national calendar with 30 days (starts on 23rd of September).The 6th month of Indian national calendar with 31 days (starts on 23rd of August).The 1st month of Indian national calendar.The 3rd month of Indian national calendar with 31 days (starts on 22nd of May).The 8th month of Indian national calendar with 30 days (starts on 23rd of October).The 11th month of Indian national calendar with 30 days (starts on 21th of January).The 10th month of Indian national calendar with 30 days (starts on 22nd of December).The 12th month of Indian national calendar with 30 days (starts on 20th of February).The 5th month of Indian national calendar with 31 days (starts on 23rd of July).The 2nd month of Indian national calendar with 31 days (starts on 21th of April). -
Method Summary
Modifier and TypeMethodDescriptiongetDisplayName(Locale locale)
Equivalent to the expressiongetDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT)
.getDisplayName(Locale locale, TextWidth width, OutputContext context)
Gets the description text dependent on the locale and style parameters.int
getValue()
Gets the corresponding numerical value.roll(int months)
Rolls this month by given amount of months.boolean
test(IndianCalendar context)
Decides if given context matches this condition.static IndianMonth
valueOf(int month)
Gets the enum-constant which corresponds to the given numerical value.static IndianMonth
Returns the enum constant of this class with the specified name.static IndianMonth[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
CHAITRA
The 1st month of Indian national calendar.In normal years, it has 30 days and starts on 22nd of March. But in leap years, it has 31 days and starts on 21th of March.
-
VAISHAKHA
The 2nd month of Indian national calendar with 31 days (starts on 21th of April). -
JYESHTHA
The 3rd month of Indian national calendar with 31 days (starts on 22nd of May). -
ASHADHA
The 4th month of Indian national calendar with 31 days (starts on 22nd of June). -
SHRAVANA
The 5th month of Indian national calendar with 31 days (starts on 23rd of July). -
BHAADRA
The 6th month of Indian national calendar with 31 days (starts on 23rd of August). -
ASHWIN
The 7th month of Indian national calendar with 30 days (starts on 23rd of September). -
KARTIKA
The 8th month of Indian national calendar with 30 days (starts on 23rd of October). -
AGRAHAYANA
The 9th month of Indian national calendar with 30 days (starts on 22nd of November). -
PAUSHA
The 10th month of Indian national calendar with 30 days (starts on 22nd of December). -
MAGHA
The 11th month of Indian national calendar with 30 days (starts on 21th of January). -
PHALGUNA
The 12th month of Indian national calendar with 30 days (starts on 20th of February).
-
-
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
-
valueOf
Gets the enum-constant which corresponds to the given numerical value.
- Parameters:
month
- Indian month in the range [1-12]- Returns:
- Indian month of year as enum
- Throws:
IllegalArgumentException
- if given argument is out of range
-
getValue
public int getValue()Gets the corresponding numerical value.
- Returns:
- number of month in the range [1-12]
-
getDisplayName
Equivalent to the expression
getDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT)
.- Parameters:
locale
- language setting- Returns:
- descriptive text (long form, never
null
) - See Also:
getDisplayName(Locale, TextWidth, OutputContext)
-
getDisplayName
Gets the description text dependent on the locale and style parameters.
The second argument controls the width of description while the third argument is only relevant for languages which make a difference between stand-alone forms and embedded text forms (does not matter in English).
- Parameters:
locale
- language settingwidth
- text widthcontext
- output context- Returns:
- descriptive text for given locale and style (never
null
)
-
test
Description copied from interface:ChronoCondition
Decides if given context matches this condition.
Due to better readability it is recommended to use following equivalent approach instead of this method::
import static net.time4j.Weekday.SATURDAY; import static net.time4j.Month.JANUARY; PlainDate date = PlainDate.of(2014, JANUARY, 25); System.out.println(SATURDAY.test(date)); // direct use System.out.println(date.matches(SATURDAY)); // recommended callback
- Specified by:
test
in interfaceChronoCondition<IndianCalendar>
- Specified by:
test
in interfacePredicate<IndianCalendar>
- Parameters:
context
- context as base of testing this condition- Returns:
true
if given time context matches this condition elsefalse
-
roll
Rolls this month by given amount of months.
- Parameters:
months
- count of months (maybe negative)- Returns:
- result of rolling operation
- Since:
- 5.7
-