Class EraRules

java.lang.Object
org.graalvm.shadowed.com.ibm.icu.impl.EraRules

public class EraRules extends Object
EraRules represents calendar era rules specified in supplementalData/calendarData.
  • Field Details

    • MIN_ENCODED_START

      public static final int MIN_ENCODED_START
  • Method Details

    • getInstance

      public static EraRules getInstance(CalType calType, boolean includeTentativeEra)
    • getNumberOfEras

      public int getNumberOfEras()
      Gets number of effective eras
      Returns:
      number of effective eras
    • getStartDate

      public int[] getStartDate(int eraIdx, int[] fillIn)
      Gets start date of an era
      Parameters:
      eraIdx - Era index
      fillIn - Receives date fields if supplied. If null, or size of array is less than 3, then a new int[] will be newly allocated.
      Returns:
      An int array including values of year, month, day of month in this order. When an era has no start date, the result will be January 1st in year whose value is minimum integer.
    • getStartYear

      public int getStartYear(int eraIdx)
      Gets start year of an era
      Parameters:
      eraIdx - Era index
      Returns:
      The first year of an era. When a era has no start date, minimum integer value is returned.
    • getEraIndex

      public int getEraIndex(int year, int month, int day)
      Returns era index for the specified year/month/day.
      Parameters:
      year - Year
      month - Month (1-base)
      day - Day of month
      Returns:
      era index (or 0, when the specified date is before the first era)
    • getCurrentEraIndex

      public int getCurrentEraIndex()
      Gets the current era index. This is calculated only once for an instance of EraRules. The current era calculation is based on the default time zone at the time of instantiation.
      Returns:
      era index of current era (or 0, when current date is before the first era)