This chronology defines the rules of a proleptic 52/53-week Accounting calendar system.
This calendar system follows the rules as laid down in IRS Publication 538
and the International Financial Reporting Standards.
The start of the Accounting calendar will vary against the ISO calendar.
Depending on options chosen, it can start as early as 0000-01-26 (ISO) or as late as 0001-01-04 (ISO).
This class is proleptic. It implements Accounting chronology rules for the entire time-line.
The fields are defined as follows:
| Modifier and Type | Field and Description |
|---|---|
| private static final ValueRange | ALIGNED_WEEK_OF_YEAR_RANGE
Range of weeks in year. |
| private final transient ValueRange | alignedWeekOfMonthRange
Number of weeks in a month range. |
| pack-priv static final ValueRange | DAY_OF_YEAR_RANGE
Range of days in year. |
| private final transient ValueRange | dayOfMonthRange
Number of days in a month range. |
| private final transient int | days0001ToIso1970
Number of days from the start of Accounting year 1 (for this chronology) to the start of ISO 1970 |
| private final AccountingYearDivision | division
How to divide an accounting year. |
| private final Month | end
Which Gregorian/ISO end-of-month the year ends in/is nearest to. |
| private final DayOfWeek | endsOn
The day of the week on which a given Accounting year ends. |
| private final boolean | inLastWeek
Whether the calendar ends in the last week of a given Gregorian/ISO month, or nearest to the last day of the month (will sometimes be in the next month). |
| private final int | leapWeekInMonth
The month which will have the leap-week added. |
| private static final ValueRange | PROLEPTIC_MONTH_RANGE_12
Range of proleptic month for 12-month (period) year. |
| private static final ValueRange | PROLEPTIC_MONTH_RANGE_13
Range of proleptic month for 13-month (period) year. |
| private static final long | serialVersionUID
Serialization version. |
| private final int | yearOffset
The year offset. |
| private final transient int | yearZeroDifference
Difference in days between accounting year end and ISO month end, in ISO year 0. |
| Access | Constructor and Description |
|---|---|
| private | AccountingChronology(DayOfWeek
The day-of-week a given year ends on. endsOn, Month The month-end the year is based on. end, boolean Whether the year ends in the last week of the month, or nearest the end-of-month. inLastWeek, AccountingYearDivision How the year is divided. division, int The month in which the leap-week resides. leapWeekInMonth, int Difference in days between accounting year end and ISO month end, in ISO year 0. yearZeroDifference, ValueRange Range of weeks in month. alignedWeekOfMonthRange, ValueRange Range of days in month. dayOfMonthRange, int The number of days between the start of Accounting 1 and ISO 1970. daysToEpoch, int yearOffset)Creates an instance from validated data, and cached data. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static AccountingChronology | Returns: The created Chronology, not null.The day-of-week a given year ends on. endsOn, Month The month-end the year is based on. end, boolean Whether the year ends in the last week of the month, or nearest the end-of-month. inLastWeek, AccountingYearDivision How the year is divided. division, int The month in which the leap-week resides. leapWeekInMonth, int yearOffset)Creates an |
| public AccountingDate | Returns: the Accounting local date, not nullthe Accounting era, not null era, int the year-of-era yearOfEra, int the month-of-year month, int the day-of-month dayOfMonth)Overrides default java. Obtains a local date in Accounting calendar system from the era, year-of-era, month-of-year and day-of-month fields. |
| public AccountingDate | Returns: the Accounting local date, not nullthe proleptic-year prolepticYear, int the month-of-year month, int the day-of-month dayOfMonth)Implements java. Obtains a local date in Accounting calendar system from the proleptic-year, month-of-year and day-of-month fields. |
| public AccountingDate | Returns: the Accounting local date, not nullthe date-time object to convert, not null temporal)Implements java. Obtains a Accounting local date from another date-time object. |
| public AccountingDate | Returns: the Accounting local date, not nullthe epoch day epochDay)Implements java. Obtains a local date in the Accounting calendar system from the epoch-day. |
| public AccountingDate | Returns: the current Accounting local date using the system clock and default time-zone, not nullOverrides default java. Obtains the current Accounting local date from the system clock in the default time-zone. |
| public AccountingDate | Returns: the current Accounting local date using the system clock, not nullthe zone ID to use, not null zone)Overrides default java. Obtains the current Accounting local date from the system clock in the specified time-zone. |
| public AccountingDate | Returns: the current Accounting local date, not nullthe clock to use, not null clock)Overrides default java. Obtains the current Accounting local date from the specified clock. |
| public AccountingDate | Returns: the Accounting local date, not nullthe Accounting era, not null era, int the year-of-era yearOfEra, int the day-of-year dayOfYear)Overrides default java. Obtains a local date in Accounting calendar system from the era, year-of-era and day-of-year fields. |
| public AccountingDate | Returns: the Accounting local date, not nullthe proleptic-year prolepticYear, int the day-of-year dayOfYear)Implements java. Obtains a local date in Accounting calendar system from the proleptic-year and day-of-year fields. |
| public boolean | equals(Object
the object to check, null returns false obj)Overrides java. Implements java. Checks if this chronology is equal to another chronology. |
| public AccountingEra | eraOf(int
the era value era)Implements java. Creates the chronology era object from the numeric value. |
| public List | |
| public String | Returns: null, as the calendar is unlikely to be specified in LDMLImplements java. Gets the calendar type of the underlying calendar system, which is null. |
| pack-priv int | |
| pack-priv AccountingYearDivision | |
| public String | Returns: the chronology ID - 'Accounting'Implements java. Gets the ID of the chronology - 'Accounting'. |
| private long | Returns: the count of leap years since year 1.the proleptic-year to check, not validated for range prolepticYear)Return the number of ISO Leap Years since Accounting Year 1. |
| pack-priv int | |
| public int | hashCode()
Overrides java. Implements java. A hash code for this chronology. |
| public boolean | Returns: true if the year is a leap yearthe proleptic-year to check, not validated for range prolepticYear)Implements java. Checks if the specified year is a leap year. |
| public ChronoLocalDateTime | Returns: the Accounting local date-time, not nullthe date-time object to convert, not null temporal)Overrides default java. Obtains a Accounting local date-time from another date-time object. |
| pack-priv long | Returns: the count of leap years since year 1.the proleptic-year to check, not validated for range prolepticYear)Returns the count of leap years since year 1. |
| public int | prolepticYear(Era
the era of the correct type for the chronology, not null era, int the chronology year-of-era yearOfEra)Implements java. Calculates the proleptic-year given the era and year-of-era. |
| public ValueRange | range(ChronoField
the field to get the range for, not null field)Implements java. Gets the range of valid values for the specified field. |
| private Object | |
| public String | toString()
Overrides java. Implements java. Outputs this chronology as a |
| public ChronoZonedDateTime | Returns: the Accounting zoned date-time, not nullthe date-time object to convert, not null temporal)Overrides default java. Obtains a Accounting zoned date-time from another date-time object. |
| public ChronoZonedDateTime | Returns: the Accounting zoned date-time, not nullthe instant to create the date-time from, not null instant, ZoneId the time-zone, not null zone)Overrides default java. Obtains a Accounting zoned date-time in this chronology from an |
| ALIGNED_WEEK_OF_YEAR_RANGE | back to summary |
|---|---|
| private static final ValueRange ALIGNED_WEEK_OF_YEAR_RANGE Range of weeks in year. | |
| alignedWeekOfMonthRange | back to summary |
|---|---|
| private final transient ValueRange alignedWeekOfMonthRange Number of weeks in a month range. | |
| DAY_OF_YEAR_RANGE | back to summary |
|---|---|
| pack-priv static final ValueRange DAY_OF_YEAR_RANGE Range of days in year. | |
| dayOfMonthRange | back to summary |
|---|---|
| private final transient ValueRange dayOfMonthRange Number of days in a month range. | |
| days0001ToIso1970 | back to summary |
|---|---|
| private final transient int days0001ToIso1970 Number of days from the start of Accounting year 1 (for this chronology) to the start of ISO 1970 | |
| division | back to summary |
|---|---|
| private final AccountingYearDivision division How to divide an accounting year. | |
| end | back to summary |
|---|---|
| private final Month end Which Gregorian/ISO end-of-month the year ends in/is nearest to. | |
| endsOn | back to summary |
|---|---|
| private final DayOfWeek endsOn The day of the week on which a given Accounting year ends. | |
| inLastWeek | back to summary |
|---|---|
| private final boolean inLastWeek Whether the calendar ends in the last week of a given Gregorian/ISO month, or nearest to the last day of the month (will sometimes be in the next month). | |
| leapWeekInMonth | back to summary |
|---|---|
| private final int leapWeekInMonth The month which will have the leap-week added. | |
| PROLEPTIC_MONTH_RANGE_12 | back to summary |
|---|---|
| private static final ValueRange PROLEPTIC_MONTH_RANGE_12 Range of proleptic month for 12-month (period) year. | |
| PROLEPTIC_MONTH_RANGE_13 | back to summary |
|---|---|
| private static final ValueRange PROLEPTIC_MONTH_RANGE_13 Range of proleptic month for 13-month (period) year. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Serialization version. | |
| yearOffset | back to summary |
|---|---|
| private final int yearOffset The year offset. | |
| yearZeroDifference | back to summary |
|---|---|
| private final transient int yearZeroDifference Difference in days between accounting year end and ISO month end, in ISO year 0. | |
| AccountingChronology | back to summary |
|---|---|
| private AccountingChronology(DayOfWeek endsOn, Month end, boolean inLastWeek, AccountingYearDivision division, int leapWeekInMonth, int yearZeroDifference, ValueRange alignedWeekOfMonthRange, ValueRange dayOfMonthRange, int daysToEpoch, int yearOffset) Creates an instance from validated data, and cached data.
| |
| create | back to summary |
|---|---|
| pack-priv static AccountingChronology create(DayOfWeek endsOn, Month end, boolean inLastWeek, AccountingYearDivision division, int leapWeekInMonth, int yearOffset) Creates an
| |
| date | back to summary |
|---|---|
| public AccountingDate date(Era era, int yearOfEra, int month, int dayOfMonth) Overrides default java. Obtains a local date in Accounting calendar system from the era, year-of-era, month-of-year and day-of-month fields.
| |
| date | back to summary |
|---|---|
| public AccountingDate date(int prolepticYear, int month, int dayOfMonth) Implements java. Obtains a local date in Accounting calendar system from the proleptic-year, month-of-year and day-of-month fields.
| |
| date | back to summary |
|---|---|
| public AccountingDate date(TemporalAccessor temporal) Implements java. Obtains a Accounting local date from another date-time object.
| |
| dateEpochDay | back to summary |
|---|---|
| public AccountingDate dateEpochDay(long epochDay) Implements java. Obtains a local date in the Accounting calendar system from the epoch-day.
| |
| dateNow | back to summary |
|---|---|
| public AccountingDate dateNow() Overrides default java. Obtains the current Accounting local date from the system clock in the default time-zone.
This will query the Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
| |
| dateNow | back to summary |
|---|---|
| public AccountingDate dateNow(ZoneId zone) Overrides default java. Obtains the current Accounting local date from the system clock in the specified time-zone.
This will query the Using this method will prevent the ability to use an alternate clock for testing because the clock is hard-coded.
| |
| dateNow | back to summary |
|---|---|
| public AccountingDate dateNow(Clock clock) Overrides default java. Obtains the current Accounting local date from the specified clock.
This will query the specified clock to obtain the current date - today.
Using this method allows the use of an alternate clock for testing.
The alternate clock may be introduced using
| |
| dateYearDay | back to summary |
|---|---|
| public AccountingDate dateYearDay(Era era, int yearOfEra, int dayOfYear) Overrides default java. Obtains a local date in Accounting calendar system from the era, year-of-era and day-of-year fields.
| |
| dateYearDay | back to summary |
|---|---|
| public AccountingDate dateYearDay(int prolepticYear, int dayOfYear) Implements java. Obtains a local date in Accounting calendar system from the proleptic-year and day-of-year fields.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Implements java. Doc from java. Checks if this chronology is equal to another chronology. The comparison is based on the entire state of the object. | |
| eraOf | back to summary |
|---|---|
| public AccountingEra eraOf(int era) Implements java. Doc from java. Creates the chronology era object from the numeric value. The era is, conceptually, the largest division of the time-line. Most calendar systems have a single epoch dividing the time-line into two eras. However, some have multiple eras, such as one for the reign of each leader. The exact meaning is determined by the chronology according to the following constraints. The era in use at 1970-01-01 must have the value 1. Later eras must have sequentially higher values. Earlier eras must have sequentially lower values. Each chronology must refer to an enum or similar singleton to provide the era values. This method returns the singleton era of the correct type for the specified era value.
| |
| eras | back to summary |
|---|---|
| public List Implements java. Doc from java. Gets the list of eras for the chronology. Most calendar systems have an era, within which the year has meaning. If the calendar system does not support the concept of eras, an empty list must be returned. | |
| getCalendarType | back to summary |
|---|---|
| public String getCalendarType() Implements java. Gets the calendar type of the underlying calendar system, which is null. The Unicode Locale Data Markup Language (LDML) specification does not define an identifier for 52/53 week calendars used for accounting purposes, and given that setup required is unlikely to do so. For this reason, the calendar type is null. | |
| getDays0001ToIso1970 | back to summary |
|---|---|
| pack-priv int getDays0001ToIso1970() | |
| getDivision | back to summary |
|---|---|
| pack-priv AccountingYearDivision getDivision() | |
| getId | back to summary |
|---|---|
| public String getId() Implements java. Gets the ID of the chronology - 'Accounting'.
The ID uniquely identifies the
| |
| getISOLeapYearCount | back to summary |
|---|---|
| private long getISOLeapYearCount(long prolepticYear) Return the number of ISO Leap Years since Accounting Year 1. This method calculates how many ISO leap years have passed since year 1. The count returned may be negative for years before 1. This method does not validate the year passed in, and only has a well-defined result for years in the supported range.
| |
| getLeapWeekInMonth | back to summary |
|---|---|
| pack-priv int getLeapWeekInMonth() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Implements java. Doc from java. A hash code for this chronology. The hash code should be based on the entire state of the object.
| |
| isLeapYear | back to summary |
|---|---|
| public boolean isLeapYear(long prolepticYear) Implements java. Checks if the specified year is a leap year. An Accounting proleptic-year is leap if the time between the end of the previous year and the end of the current year is 371 days. This method does not validate the year passed in, and only has a well-defined result for years in the supported range.
| |
| localDateTime | back to summary |
|---|---|
| public ChronoLocalDateTime Overrides default java. Obtains a Accounting local date-time from another date-time object.
| |
| previousLeapYears | back to summary |
|---|---|
| pack-priv long previousLeapYears(long prolepticYear) Returns the count of leap years since year 1. This method calculates how many Accounting leap years have passed since year 1. The count returned may be negative for years before 1. This method does not validate the year passed in, and only has a well-defined result for years in the supported range.
| |
| prolepticYear | back to summary |
|---|---|
| public int prolepticYear(Era era, int yearOfEra) Implements java. Doc from java. Calculates the proleptic-year given the era and year-of-era. This combines the era and year-of-era into the single proleptic-year field.
If the chronology makes active use of eras, such as | |
| range | back to summary |
|---|---|
| public ValueRange range(ChronoField field) Implements java. Doc from java. Gets the range of valid values for the specified field.
All fields can be expressed as a Note that the result only describes the minimum and maximum valid values and it is important not to read too much into them. For example, there could be values within the range that are invalid for the field. This method will return a result whether or not the chronology supports the field.
| |
| readResolve | back to summary |
|---|---|
| private Object readResolve() Resolve stored instances.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Doc from java. Outputs this chronology as a | |
| zonedDateTime | back to summary |
|---|---|
| public ChronoZonedDateTime Overrides default java. Obtains a Accounting zoned date-time from another date-time object.
| |
| zonedDateTime | back to summary |
|---|---|
| public ChronoZonedDateTime Overrides default java. Obtains a Accounting zoned date-time in this chronology from an
| |