Enum Class IndianMonth

java.lang.Object
java.lang.Enum<IndianMonth>
net.time4j.calendar.IndianMonth
All Implemented Interfaces:
Serializable, Comparable<IndianMonth>, java.lang.constant.Constable, Predicate<IndianCalendar>, ChronoCondition<IndianCalendar>

public enum IndianMonth extends Enum<IndianMonth> implements 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 Constants
    Enum Constant
    Description
    The 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 Type
    Method
    Description
    Equivalent to the expression getDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT).
    getDisplayName​(Locale locale, TextWidth width, OutputContext context)
    Gets the description text dependent on the locale and style parameters.
    int
    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.
    valueOf​(int month)
    Gets the enum-constant which corresponds to the given numerical value.
    valueOf​(String name)
    Returns the enum constant of this class with the specified name.
    static IndianMonth[]
    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

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Enum Constant Details

    • CHAITRA

      public static final IndianMonth 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

      public static final IndianMonth VAISHAKHA
      The 2nd month of Indian national calendar with 31 days (starts on 21th of April).
    • JYESHTHA

      public static final IndianMonth JYESHTHA
      The 3rd month of Indian national calendar with 31 days (starts on 22nd of May).
    • ASHADHA

      public static final IndianMonth ASHADHA
      The 4th month of Indian national calendar with 31 days (starts on 22nd of June).
    • SHRAVANA

      public static final IndianMonth SHRAVANA
      The 5th month of Indian national calendar with 31 days (starts on 23rd of July).
    • BHAADRA

      public static final IndianMonth BHAADRA
      The 6th month of Indian national calendar with 31 days (starts on 23rd of August).
    • ASHWIN

      public static final IndianMonth ASHWIN
      The 7th month of Indian national calendar with 30 days (starts on 23rd of September).
    • KARTIKA

      public static final IndianMonth KARTIKA
      The 8th month of Indian national calendar with 30 days (starts on 23rd of October).
    • AGRAHAYANA

      public static final IndianMonth AGRAHAYANA
      The 9th month of Indian national calendar with 30 days (starts on 22nd of November).
    • PAUSHA

      public static final IndianMonth PAUSHA
      The 10th month of Indian national calendar with 30 days (starts on 22nd of December).
    • MAGHA

      public static final IndianMonth MAGHA
      The 11th month of Indian national calendar with 30 days (starts on 21th of January).
    • PHALGUNA

      public static final IndianMonth PHALGUNA
      The 12th month of Indian national calendar with 30 days (starts on 20th of February).
  • Method Details

    • values

      public static IndianMonth[] 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

      public static IndianMonth valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • valueOf

      public static IndianMonth valueOf(int month)

      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

      public String getDisplayName(Locale locale)

      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

      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).

      Parameters:
      locale - language setting
      width - text width
      context - output context
      Returns:
      descriptive text for given locale and style (never null)
    • test

      public boolean test(IndianCalendar context)
      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 interface ChronoCondition<IndianCalendar>
      Specified by:
      test in interface Predicate<IndianCalendar>
      Parameters:
      context - context as base of testing this condition
      Returns:
      true if given time context matches this condition else false
    • roll

      public IndianMonth roll(int months)

      Rolls this month by given amount of months.

      Parameters:
      months - count of months (maybe negative)
      Returns:
      result of rolling operation
      Since:
      5.7