Enum Class HebrewMonth

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

public enum HebrewMonth extends Enum<HebrewMonth> implements ChronoCondition<HebrewCalendar>

The Hebrew calendar defines 13 Hebrew months.

Since:
3.37/4.32
Author:
Meno Hochschild
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Determines which order should be applied on Hebrew months.

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The 6th month of Hebrew calendar with 30 days (leap month).
    The 7th month of Hebrew calendar with 29 days.
    The 12th month of Hebrew calendar with 30 days (11th month in non-leap-years).
    The 13th month of Hebrew calendar with 29 days (12th month in non-leap-years).
    The 2nd month of Hebrew calendar with 29 or 30 days.
    The 9th month of Hebrew calendar with 29 days (8th month in non-leap-years).
    The 3rd month of Hebrew calendar with 29 or 30 days.
    The 8th month of Hebrew calendar with 30 days (7th month in non-leap-years).
    The 5th month of Hebrew calendar with 30 days.
    The 10th month of Hebrew calendar with 30 days (9th month in non-leap-years).
    The 11th month of Hebrew calendar with 29 days (10th month in non-leap-years).
    The 4th month of Hebrew calendar with 29 days.
    The 1st month of Hebrew calendar with 30 days.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getBiblicalValue​(boolean leapYear)
    Gets the corresponding numerical value in biblical order.
    int
    getCivilValue​(boolean leapYear)
    Gets the corresponding numerical value in usual civil order.
    getDisplayName​(Locale locale, boolean leapYear)
    Equivalent to the expression getDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT, leapYear).
    getDisplayName​(Locale locale, TextWidth width, OutputContext context, boolean leapYear)
    Gets the description text dependent on the locale and style parameters.
    Format attribute which expects months to be numerical with a specific order.
    boolean
    test​(HebrewCalendar context)
    Decides if given context matches this condition.
    valueOf​(String name)
    Returns the enum constant of this class with the specified name.
    valueOfBiblical​(int month, boolean leapYear)
    Gets the enum-constant which corresponds to the given numerical value (in biblical order).
    valueOfCivil​(int month, boolean leapYear)
    Gets the enum-constant which corresponds to the given numerical value (in standard civil order).
    static HebrewMonth[]
    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

    • TISHRI

      public static final HebrewMonth TISHRI
      The 1st month of Hebrew calendar with 30 days.
    • HESHVAN

      public static final HebrewMonth HESHVAN
      The 2nd month of Hebrew calendar with 29 or 30 days.
    • KISLEV

      public static final HebrewMonth KISLEV
      The 3rd month of Hebrew calendar with 29 or 30 days.
    • TEVET

      public static final HebrewMonth TEVET
      The 4th month of Hebrew calendar with 29 days.
    • SHEVAT

      public static final HebrewMonth SHEVAT
      The 5th month of Hebrew calendar with 30 days.
    • ADAR_I

      public static final HebrewMonth ADAR_I
      The 6th month of Hebrew calendar with 30 days (leap month).

      Note: This month only occurs in leap years.

    • ADAR_II

      public static final HebrewMonth ADAR_II
      The 7th month of Hebrew calendar with 29 days.

      Note: This month is just called "ADAR" and is effectively the sixth month if it is not in a leap year.

    • NISAN

      public static final HebrewMonth NISAN
      The 8th month of Hebrew calendar with 30 days (7th month in non-leap-years).
    • IYAR

      public static final HebrewMonth IYAR
      The 9th month of Hebrew calendar with 29 days (8th month in non-leap-years).
    • SIVAN

      public static final HebrewMonth SIVAN
      The 10th month of Hebrew calendar with 30 days (9th month in non-leap-years).
    • TAMUZ

      public static final HebrewMonth TAMUZ
      The 11th month of Hebrew calendar with 29 days (10th month in non-leap-years).
    • AV

      public static final HebrewMonth AV
      The 12th month of Hebrew calendar with 30 days (11th month in non-leap-years).
    • ELUL

      public static final HebrewMonth ELUL
      The 13th month of Hebrew calendar with 29 days (12th month in non-leap-years).
  • Method Details

    • values

      public static HebrewMonth[] 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 HebrewMonth 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
    • valueOfCivil

      public static HebrewMonth valueOfCivil(int month, boolean leapYear)

      Gets the enum-constant which corresponds to the given numerical value (in standard civil order).

      Parameters:
      month - civil number of month in the range [1-13]
      leapYear - called in a leap year context?
      Returns:
      hebrew month of year as enum
      Throws:
      IllegalArgumentException - if given argument is out of range
      See Also:
      HebrewMonth.Order.CIVIL
    • valueOfBiblical

      public static HebrewMonth valueOfBiblical(int month, boolean leapYear)

      Gets the enum-constant which corresponds to the given numerical value (in biblical order).

      Parameters:
      month - biblical number of month in the range [1-13]
      leapYear - called in a leap year context?
      Returns:
      hebrew month of year as enum
      Throws:
      IllegalArgumentException - if given argument is out of range
      See Also:
      HebrewMonth.Order.BIBLICAL
    • getCivilValue

      public int getCivilValue(boolean leapYear)

      Gets the corresponding numerical value in usual civil order.

      The first month is TISHRI. All months starting with ADAR-II or later decrement the numerical value by 1 if this method is called for a normal year.

      Parameters:
      leapYear - called in a leap year context?
      Returns:
      civil number of month in the range [1-13]
      See Also:
      HebrewMonth.Order.CIVIL
    • getBiblicalValue

      public int getBiblicalValue(boolean leapYear)

      Gets the corresponding numerical value in biblical order.

      The first month in biblical order (Leviticus 23:5) is NISAN. The last month ADAR-II will have the number 12 in normal years and 13 in leap years.

      Parameters:
      leapYear - called in a leap year context?
      Returns:
      biblical number of month in the range [1-13]
      See Also:
      HebrewMonth.Order.BIBLICAL
    • getDisplayName

      public String getDisplayName(Locale locale, boolean leapYear)

      Equivalent to the expression getDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT, leapYear).

      Parameters:
      locale - language setting
      leapYear - called in a leap year context?
      Returns:
      descriptive text (long form, never null)
      See Also:
      getDisplayName(Locale, TextWidth, OutputContext, boolean)
    • getDisplayName

      public String getDisplayName(Locale locale, TextWidth width, OutputContext context, boolean leapYear)

      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
      leapYear - called in a leap year context?
      Returns:
      descriptive text for given locale and style (never null)
    • test

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

      public static AttributeKey<HebrewMonth.Order> order()

      Format attribute which expects months to be numerical with a specific order.

      Returns:
      format attribute key