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, toString
centuries, 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, years
private 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)
BasicChronology
setYear
in class BasicChronology
instant
- millis from 1970-01-01T00:00:00Zyear
- the year to setlong getYearDifference(long minuendInstant, long subtrahendInstant)
BasicChronology
getYearDifference
in class BasicChronology
minuendInstant
- the first instantsubtrahendInstant
- the second instantlong getTotalMillisByYearMonth(int year, int month)
BasicChronology
getTotalMillisByYearMonth
in class BasicChronology
year
- the yearmonth
- the monthint getDayOfMonth(long millis)
getDayOfMonth
in class BasicChronology
millis
- from 1970-01-01T00:00:00Zboolean isLeapYear(int year)
BasicChronology
isLeapYear
in class BasicChronology
year
- the year to testint getDaysInYearMonth(int year, int month)
BasicChronology
getDaysInYearMonth
in class BasicChronology
year
- the yearmonth
- the monthint getDaysInMonthMax()
BasicChronology
getDaysInMonthMax
in class BasicChronology
int getDaysInMonthMax(int month)
BasicChronology
getDaysInMonthMax
in class BasicChronology
month
- the monthint getMonthOfYear(long millis)
getMonthOfYear
in class BasicChronology
millis
- from 1970-01-01T00:00:00Zint getMonthOfYear(long millis, int year)
getMonthOfYear
in class BasicChronology
millis
- from 1970-01-01T00:00:00Zyear
- precalculated year of millisint getMaxMonth()
BasicChronology
getMaxMonth
in class BasicChronology
long getAverageMillisPerYear()
BasicChronology
getAverageMillisPerYear
in class BasicChronology
long getAverageMillisPerYearDividedByTwo()
BasicChronology
getAverageMillisPerYearDividedByTwo
in class BasicChronology
long getAverageMillisPerMonth()
BasicChronology
getAverageMillisPerMonth
in class BasicChronology