EraRules represents calendar era rules specified
in supplementalData/calendarData.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final int | |
| private static final int | |
| public static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private int[] | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static int | Returns: -1 when encoded date is earlier, 0 when two dates are same, and 1 when encoded date is later.An encoded date encoded, int Year of another date year, int Month of another date month, int Day of another date day)Compare an encoded date with another date specified by year/month/day. |
| private static int[] | |
| private static int | Returns: an encoded date.year year, int month (1-base) month, int day of month day)Encode year/month/date to a single integer. |
| public int | Returns: era index of current era (or 0, when current date is before the first era)Gets the current era index. |
| public int | Returns: era index (or 0, when the specified date is before the first era)Year year, int Month (1-base) month, int Day of month day)Returns era index for the specified year/month/day. |
| public static EraRules | |
| public int | |
| public int[] | 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.Era index eraIdx, int[] Receives date fields if supplied. If null, or size of array
is less than 3, then a new int[] will be newly allocated. fillIn)Gets start date of an era |
| public int | Returns: The first year of an era. When a era has no start date, minimum integer value is returned.Era index eraIdx)Gets start year of an era |
| private void | |
| private static boolean | |
| private static boolean |
| currentEra | back to summary |
|---|---|
| private int currentEra | |
| DAY_MASK | back to summary |
|---|---|
| private static final int DAY_MASK | |
| MAX_ENCODED_START_YEAR | back to summary |
|---|---|
| private static final int MAX_ENCODED_START_YEAR | |
| MIN_ENCODED_START | back to summary |
|---|---|
| public static final int MIN_ENCODED_START | |
| MIN_ENCODED_START_YEAR | back to summary |
|---|---|
| private static final int MIN_ENCODED_START_YEAR | |
| MONTH_MASK | back to summary |
|---|---|
| private static final int MONTH_MASK | |
| numEras | back to summary |
|---|---|
| private int numEras | |
| startDates | back to summary |
|---|---|
| private int[] startDates | |
| YEAR_MASK | back to summary |
|---|---|
| private static final int YEAR_MASK | |
| EraRules | back to summary |
|---|---|
| private EraRules(int[] startDates, int numEras) | |
| compareEncodedDateWithYMD | back to summary |
|---|---|
| private static int compareEncodedDateWithYMD(int encoded, int year, int month, int day) Compare an encoded date with another date specified by year/month/day.
| |
| decodeDate | back to summary |
|---|---|
| private static int[] decodeDate(int encodedDate, int[] fillIn) | |
| encodeDate | back to summary |
|---|---|
| private static int encodeDate(int year, int month, int day) Encode year/month/date to a single integer. year is high 16 bits (-32768 to 32767), month is next 8 bits and day of month is last 8 bits.
| |
| getCurrentEraIndex | back to summary |
|---|---|
| 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.
| |
| getEraIndex | back to summary |
|---|---|
| public int getEraIndex(int year, int month, int day) Returns era index for the specified year/month/day.
| |
| getInstance | back to summary |
|---|---|
| public static EraRules getInstance(CalType calType, boolean includeTentativeEra) | |
| getNumberOfEras | back to summary |
|---|---|
| public int getNumberOfEras() Gets number of effective eras
| |
| getStartDate | back to summary |
|---|---|
| public int[] getStartDate(int eraIdx, int[] fillIn) Gets start date of an era
| |
| getStartYear | back to summary |
|---|---|
| public int getStartYear(int eraIdx) Gets start year of an era
| |
| initCurrentEra | back to summary |
|---|---|
| private void initCurrentEra() | |
| isSet | back to summary |
|---|---|
| private static boolean isSet(int startDate) | |
| isValidRuleStartDate | back to summary |
|---|---|
| private static boolean isValidRuleStartDate(int year, int month, int day) | |