abstract class BasicFixedMonthChronology extends BasicChronology
As the month length is fixed various calculations can be optimised. This implementation assumes any additional days after twelve months fall into a thirteenth month.
BasicFixedMonthChronology is thread-safe and immutable, and all subclasses must be as well.
AssembledChronology.Fields| Modifier and Type | Field and Description |
|---|---|
(package private) static long |
MILLIS_PER_MONTH
The length of the month in millis.
|
(package private) static long |
MILLIS_PER_YEAR
The typical millis per year.
|
(package private) static int |
MONTH_LENGTH
The length of the month.
|
private static long |
serialVersionUID
Serialization lock
|
| Constructor and Description |
|---|
BasicFixedMonthChronology(Chronology base,
java.lang.Object param,
int minDaysInFirstWeek)
Restricted constructor.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) long |
getAverageMillisPerMonth()
Gets an average value for the milliseconds per month.
|
(package private) long |
getAverageMillisPerYear()
Gets an average value for the milliseconds per year.
|
(package private) long |
getAverageMillisPerYearDividedByTwo()
Gets an average value for the milliseconds per year, divided by two.
|
(package private) int |
getDayOfMonth(long millis) |
(package private) int |
getDaysInMonthMax()
Gets the maximum number of days in any month.
|
(package private) int |
getDaysInMonthMax(int month)
Gets the maximum days in the specified month.
|
(package private) int |
getDaysInYearMonth(int year,
int month)
Gets the number of days in the specified month and year.
|
(package private) int |
getMaxMonth()
Gets the maximum number of months.
|
(package private) int |
getMonthOfYear(long millis) |
(package private) int |
getMonthOfYear(long millis,
int year) |
(package private) long |
getTotalMillisByYearMonth(int year,
int month)
Gets the total number of millis elapsed in this year at the start
of the specified month, such as zero for month 1.
|
(package private) long |
getYearDifference(long minuendInstant,
long subtrahendInstant)
Gets the difference between the two instants in years.
|
(package private) boolean |
isLeapYear(int year)
Is the specified year a leap year?
|
(package private) long |
setYear(long instant,
int year)
Sets the year from an instant and year.
|
assemble, calculateFirstDayOfYearMillis, equals, getApproxMillisAtEpochDividedByTwo, getDateMidnightMillis, getDateTimeMillis, getDateTimeMillis, getDayOfMonth, getDayOfMonth, getDayOfWeek, getDayOfYear, getDayOfYear, getDaysInMonthMax, getDaysInMonthMaxForSet, getDaysInYear, getDaysInYearMax, getFirstWeekOfYearMillis, getMaxMonth, getMaxYear, getMillisOfDay, getMinimumDaysInFirstWeek, getMinYear, getWeekOfWeekyear, getWeekOfWeekyear, getWeeksInYear, getWeekyear, getYear, getYearMillis, getYearMonthDayMillis, getYearMonthMillis, getZone, hashCode, isLeapDay, toStringcenturies, centuryOfEra, clockhourOfDay, clockhourOfHalfday, dayOfMonth, dayOfWeek, dayOfYear, days, era, eras, getBase, getDateTimeMillis, getParam, halfdayOfDay, halfdays, hourOfDay, hourOfHalfday, hours, millis, millisOfDay, millisOfSecond, minuteOfDay, minuteOfHour, minutes, monthOfYear, months, secondOfDay, secondOfMinute, seconds, weekOfWeekyear, weeks, weekyear, weekyearOfCentury, weekyears, year, yearOfCentury, yearOfEra, yearsprivate static final long serialVersionUID
static final int MONTH_LENGTH
static final long MILLIS_PER_YEAR
static final long MILLIS_PER_MONTH
BasicFixedMonthChronology(Chronology base, java.lang.Object param, int minDaysInFirstWeek)
base - the base chronologyparam - the init parameterminDaysInFirstWeek - the minimum days in the first weeklong setYear(long instant,
int year)
BasicChronologysetYear in class BasicChronologyinstant - millis from 1970-01-01T00:00:00Zyear - the year to setlong getYearDifference(long minuendInstant,
long subtrahendInstant)
BasicChronologygetYearDifference in class BasicChronologyminuendInstant - the first instantsubtrahendInstant - the second instantlong getTotalMillisByYearMonth(int year,
int month)
BasicChronologygetTotalMillisByYearMonth in class BasicChronologyyear - the yearmonth - the monthint getDayOfMonth(long millis)
getDayOfMonth in class BasicChronologymillis - from 1970-01-01T00:00:00Zboolean isLeapYear(int year)
BasicChronologyisLeapYear in class BasicChronologyyear - the year to testint getDaysInYearMonth(int year,
int month)
BasicChronologygetDaysInYearMonth in class BasicChronologyyear - the yearmonth - the monthint getDaysInMonthMax()
BasicChronologygetDaysInMonthMax in class BasicChronologyint getDaysInMonthMax(int month)
BasicChronologygetDaysInMonthMax in class BasicChronologymonth - the monthint getMonthOfYear(long millis)
getMonthOfYear in class BasicChronologymillis - from 1970-01-01T00:00:00Zint getMonthOfYear(long millis,
int year)
getMonthOfYear in class BasicChronologymillis - from 1970-01-01T00:00:00Zyear - precalculated year of millisint getMaxMonth()
BasicChronologygetMaxMonth in class BasicChronologylong getAverageMillisPerYear()
BasicChronologygetAverageMillisPerYear in class BasicChronologylong getAverageMillisPerYearDividedByTwo()
BasicChronologygetAverageMillisPerYearDividedByTwo in class BasicChronologylong getAverageMillisPerMonth()
BasicChronologygetAverageMillisPerMonth in class BasicChronology