public enum IndianMonth extends Enum<IndianMonth> implements ChronoCondition<IndianCalendar>
The Indian national calendar defines 12 indian months.
| Enum Constant and Description |
|---|
AGRAHAYANA
The 9th month of Indian national calendar with 30 days (starts on 22nd of November).
|
ASHADHA
The 4th month of Indian national calendar with 31 days (starts on 22nd of June).
|
ASHWIN
The 7th month of Indian national calendar with 30 days (starts on 23rd of September).
|
BHAADRA
The 6th month of Indian national calendar with 31 days (starts on 23rd of August).
|
CHAITRA
The 1st month of Indian national calendar.
|
JYESHTHA
The 3rd month of Indian national calendar with 31 days (starts on 22nd of May).
|
KARTIKA
The 8th month of Indian national calendar with 30 days (starts on 23rd of October).
|
MAGHA
The 11th month of Indian national calendar with 30 days (starts on 21th of January).
|
PAUSHA
The 10th month of Indian national calendar with 30 days (starts on 22nd of December).
|
PHALGUNA
The 12th month of Indian national calendar with 30 days (starts on 20th of February).
|
SHRAVANA
The 5th month of Indian national calendar with 31 days (starts on 23rd of July).
|
VAISHAKHA
The 2nd month of Indian national calendar with 31 days (starts on 21th of April).
|
| Modifier and Type | Method and Description |
|---|---|
String |
getDisplayName(Locale locale)
Equivalent to the expression
getDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT). |
String |
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.
|
IndianMonth |
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 |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IndianMonth[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IndianMonth CHAITRA
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.
public static final IndianMonth VAISHAKHA
public static final IndianMonth JYESHTHA
public static final IndianMonth ASHADHA
public static final IndianMonth SHRAVANA
public static final IndianMonth BHAADRA
public static final IndianMonth ASHWIN
public static final IndianMonth KARTIKA
public static final IndianMonth AGRAHAYANA
public static final IndianMonth PAUSHA
public static final IndianMonth MAGHA
public static final IndianMonth PHALGUNA
public static IndianMonth[] values()
for (IndianMonth c : IndianMonth.values()) System.out.println(c);
public static IndianMonth 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 static IndianMonth valueOf(int month)
Gets the enum-constant which corresponds to the given numerical value.
month - Indian month in the range [1-12]IllegalArgumentException - if given argument is out of rangepublic int getValue()
Gets the corresponding numerical value.
public String getDisplayName(Locale locale)
Equivalent to the expression
getDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT).
locale - language settingnull)getDisplayName(Locale, TextWidth, OutputContext)public String getDisplayName(Locale locale, TextWidth width, OutputContext context)
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).
locale - language settingwidth - text widthcontext - output contextnull)public boolean test(IndianCalendar context)
ChronoConditionDecides 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
test in interface Predicate<IndianCalendar>test in interface ChronoCondition<IndianCalendar>context - context as base of testing this conditiontrue if given time context matches this condition
else falsepublic IndianMonth roll(int months)
Rolls this month by given amount of months.
months - count of months (maybe negative)Copyright © 2014–2021. All rights reserved.