Enum Class HebrewMonth
- All Implemented Interfaces:
Serializable
,Comparable<HebrewMonth>
,java.lang.constant.Constable
,Predicate<HebrewCalendar>
,ChronoCondition<HebrewCalendar>
The Hebrew calendar defines 13 Hebrew months.
- Since:
- 3.37/4.32
- Author:
- Meno Hochschild
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic 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 ConstantDescriptionThe 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 TypeMethodDescriptionint
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 expressiongetDisplayName(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.static AttributeKey<HebrewMonth.Order>
order()
Format attribute which expects months to be numerical with a specific order.boolean
test(HebrewCalendar context)
Decides if given context matches this condition.static HebrewMonth
Returns the enum constant of this class with the specified name.static HebrewMonth
valueOfBiblical(int month, boolean leapYear)
Gets the enum-constant which corresponds to the given numerical value (in biblical order).static HebrewMonth
valueOfCivil(int month, boolean leapYear)
Gets the enum-constant which corresponds to the given numerical value (in standard civil order).static HebrewMonth[]
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
-
TISHRI
The 1st month of Hebrew calendar with 30 days. -
HESHVAN
The 2nd month of Hebrew calendar with 29 or 30 days. -
KISLEV
The 3rd month of Hebrew calendar with 29 or 30 days. -
TEVET
The 4th month of Hebrew calendar with 29 days. -
SHEVAT
The 5th month of Hebrew calendar with 30 days. -
ADAR_I
The 6th month of Hebrew calendar with 30 days (leap month).Note: This month only occurs in leap years.
-
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
The 8th month of Hebrew calendar with 30 days (7th month in non-leap-years). -
IYAR
The 9th month of Hebrew calendar with 29 days (8th month in non-leap-years). -
SIVAN
The 10th month of Hebrew calendar with 30 days (9th month in non-leap-years). -
TAMUZ
The 11th month of Hebrew calendar with 29 days (10th month in non-leap-years). -
AV
The 12th month of Hebrew calendar with 30 days (11th month in non-leap-years). -
ELUL
The 13th month of Hebrew calendar with 29 days (12th month in non-leap-years).
-
-
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
-
valueOfCivil
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
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
Equivalent to the expression
getDisplayName(locale, TextWidth.WIDE, OutputContext.FORMAT, leapYear)
.- Parameters:
locale
- language settingleapYear
- 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 settingwidth
- text widthcontext
- output contextleapYear
- called in a leap year 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<HebrewCalendar>
- Specified by:
test
in interfacePredicate<HebrewCalendar>
- Parameters:
context
- context as base of testing this condition- Returns:
true
if given time context matches this condition elsefalse
-
order
Format attribute which expects months to be numerical with a specific order.
- Returns:
- format attribute key
-