Enum Class HijriMonth

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

public enum HijriMonth extends Enum<HijriMonth> implements ChronoCondition<HijriCalendar>

The Hijri calendar defines 12 islamic months.

Since:
3.5/4.3
Author:
Meno Hochschild
  • Enum Constant Details

    • MUHARRAM

      public static final HijriMonth MUHARRAM
      The first month of Hijri year.
    • SAFAR

      public static final HijriMonth SAFAR
      The second month of Hijri year.
    • RABI_I

      public static final HijriMonth RABI_I
      The third month of Hijri year.
    • RABI_II

      public static final HijriMonth RABI_II
      The fourth month of Hijri year.
    • JUMADA_I

      public static final HijriMonth JUMADA_I
      The fifth month of Hijri year.
    • JUMADA_II

      public static final HijriMonth JUMADA_II
      The sixth month of Hijri year.
    • RAJAB

      public static final HijriMonth RAJAB
      The seventh month of Hijri year.
    • SHABAN

      public static final HijriMonth SHABAN
      The eigth month of Hijri year.
    • RAMADAN

      public static final HijriMonth RAMADAN
      The nineth month of Hijri year.
    • SHAWWAL

      public static final HijriMonth SHAWWAL
      The tenth month of Hijri year.
    • DHU_AL_QIDAH

      public static final HijriMonth DHU_AL_QIDAH
      The eleventh month of Hijri year.
    • DHU_AL_HIJJAH

      public static final HijriMonth DHU_AL_HIJJAH
      The twelfth and last month of Hijri year.
  • Method Details

    • values

      public static HijriMonth[] 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 HijriMonth 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 HijriMonth valueOf(int month)

      Gets the enum-constant which corresponds to the given numerical value.

      Parameters:
      month - islamic month in the range [1-12]
      Returns:
      islamic month of year as enum
      Throws:
      IllegalArgumentException - if given argument is out of range
      Since:
      3.5/4.3
    • getValue

      public int getValue()

      Gets the corresponding numerical value.

      Returns:
      number of month in the range [1-12]
      Since:
      3.5/4.3
    • 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)
      Since:
      3.5/4.3
      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)
      Since:
      3.5/4.3
    • test

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