Enum Class HinduEra

java.lang.Object
java.lang.Enum<HinduEra>
net.time4j.calendar.hindu.HinduEra
All Implemented Interfaces:
Serializable, Comparable<HinduEra>, java.lang.constant.Constable, CalendarEra

public enum HinduEra extends Enum<HinduEra> implements CalendarEra

The Hindu calendar supports several eras in different regions of Indian subcontinent.

Since:
5.6
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 onset of this era mainly used in West Bengal is 515 years after Saka.
    The onset of this ancient era (iron age) is 3179 years before Saka.
    The onset of this era mainly used in Kerala (part of Malayalam calendar) is 900 years before Saka.
    The onset of this era mainly used in Nepal is 955 years before Saka.
    The onset of this era is in gregorian year +78.
    The onset of this era mainly used in Northern India is 135 years before Saka.
  • Method Summary

    Modifier and Type
    Method
    Description
    Equivalent to the expression getDisplayName(locale, TextWidth.WIDE).
    getDisplayName​(Locale locale, TextWidth width)
    Gets the description text dependent on the locale and style parameters.
    static HinduEra
    valueOf​(String name)
    Returns the enum constant of this class with the specified name.
    static HinduEra[]
    Returns an array containing the constants of this enum class, in the order they are declared.
    int
    yearOfEra​(HinduEra era, int yearOfEra)
    Scales given year of era to another year related to this era.

    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 net.time4j.engine.CalendarEra

    name
  • Enum Constant Details

    • KALI_YUGA

      public static final HinduEra KALI_YUGA
      The onset of this ancient era (iron age) is 3179 years before Saka.
    • NEPALESE

      public static final HinduEra NEPALESE
      The onset of this era mainly used in Nepal is 955 years before Saka.
    • KOLLAM

      public static final HinduEra KOLLAM
      The onset of this era mainly used in Kerala (part of Malayalam calendar) is 900 years before Saka.
    • VIKRAMA

      public static final HinduEra VIKRAMA
      The onset of this era mainly used in Northern India is 135 years before Saka.
    • SAKA

      public static final HinduEra SAKA
      The onset of this era is in gregorian year +78.
    • BENGAL

      public static final HinduEra BENGAL
      The onset of this era mainly used in West Bengal is 515 years after Saka.
  • Method Details

    • values

      public static HinduEra[] 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 HinduEra 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
    • getDisplayName

      public String getDisplayName(Locale locale)

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

      Parameters:
      locale - language setting
      Returns:
      descriptive text (long form, never null)
      See Also:
      getDisplayName(Locale, TextWidth)
    • getDisplayName

      public String getDisplayName(Locale locale, TextWidth width)

      Gets the description text dependent on the locale and style parameters.

      The second argument controls the width of description.

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

      public int yearOfEra(HinduEra era, int yearOfEra)

      Scales given year of era to another year related to this era.

      Parameters:
      era - era reference of given year
      yearOfEra - year reckoned in given era
      Returns:
      year related to this era
      Throws:
      IllegalArgumentException - if numerical overflow occurs