public final class JulianChronology extends BasicGJChronology
Although the Julian calendar did not exist before 45 BCE, this chronology assumes it did, thus it is proleptic. This implementation also fixes the start of the year at January 1.
JulianChronology is thread-safe and immutable.
GregorianChronology
,
GJChronology
,
Serialized FormAssembledChronology.Fields
Modifier and Type | Field and Description |
---|---|
private static java.util.concurrent.ConcurrentHashMap<DateTimeZone,JulianChronology[]> |
cCache
Cache of zone to chronology arrays
|
private static JulianChronology |
INSTANCE_UTC
Singleton instance of a UTC JulianChronology
|
private static int |
MAX_YEAR
The highest year that can be fully supported.
|
private static long |
MILLIS_PER_MONTH |
private static long |
MILLIS_PER_YEAR |
private static int |
MIN_YEAR
The lowest year that can be fully supported.
|
private static long |
serialVersionUID
Serialization lock
|
Constructor and Description |
---|
JulianChronology(Chronology base,
java.lang.Object param,
int minDaysInFirstWeek)
Restricted constructor
|
Modifier and Type | Method and Description |
---|---|
(package private) static int |
adjustYearForSet(int year) |
protected void |
assemble(AssembledChronology.Fields fields)
Invoked by the constructor and after deserialization to allow subclasses
to define all of its supported fields.
|
(package private) long |
calculateFirstDayOfYearMillis(int year)
Gets the millisecond value of the first day of the year.
|
(package private) long |
getApproxMillisAtEpochDividedByTwo()
Returns a constant representing the approximate number of milliseconds
elapsed from year 0 of this chronology, divided by two.
|
(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) long |
getDateMidnightMillis(int year,
int monthOfYear,
int dayOfMonth)
Gets the milliseconds for a date at midnight.
|
static JulianChronology |
getInstance()
Gets an instance of the JulianChronology in the default time zone.
|
static JulianChronology |
getInstance(DateTimeZone zone)
Gets an instance of the JulianChronology in the given time zone.
|
static JulianChronology |
getInstance(DateTimeZone zone,
int minDaysInFirstWeek)
Gets an instance of the JulianChronology in the given time zone.
|
static JulianChronology |
getInstanceUTC()
Gets an instance of the JulianChronology.
|
(package private) int |
getMaxYear()
Gets the maximum supported year.
|
(package private) int |
getMinYear()
Gets the minimum supported year.
|
(package private) boolean |
isLeapYear(int year)
Is the specified year a leap year?
|
private java.lang.Object |
readResolve()
Serialization singleton
|
Chronology |
withUTC()
Gets the Chronology in the UTC time zone.
|
Chronology |
withZone(DateTimeZone zone)
Gets the Chronology in a specific time zone.
|
getDaysInMonthMax, getDaysInMonthMaxForSet, getDaysInYearMonth, getMonthOfYear, getTotalMillisByYearMonth, getYearDifference, isLeapDay, setYear
equals, getDateTimeMillis, getDateTimeMillis, getDayOfMonth, getDayOfMonth, getDayOfMonth, getDayOfWeek, getDayOfYear, getDayOfYear, getDaysInMonthMax, getDaysInMonthMax, getDaysInYear, getDaysInYearMax, getFirstWeekOfYearMillis, getMaxMonth, getMaxMonth, getMillisOfDay, getMinimumDaysInFirstWeek, getMonthOfYear, getWeekOfWeekyear, getWeekOfWeekyear, getWeeksInYear, getWeekyear, getYear, getYearMillis, getYearMonthDayMillis, getYearMonthMillis, getZone, hashCode, 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
private static final long MILLIS_PER_YEAR
private static final long MILLIS_PER_MONTH
private static final int MIN_YEAR
private static final int MAX_YEAR
private static final JulianChronology INSTANCE_UTC
private static final java.util.concurrent.ConcurrentHashMap<DateTimeZone,JulianChronology[]> cCache
JulianChronology(Chronology base, java.lang.Object param, int minDaysInFirstWeek)
static int adjustYearForSet(int year)
public static JulianChronology getInstanceUTC()
public static JulianChronology getInstance()
public static JulianChronology getInstance(DateTimeZone zone)
zone
- the time zone to get the chronology in, null is defaultpublic static JulianChronology getInstance(DateTimeZone zone, int minDaysInFirstWeek)
zone
- the time zone to get the chronology in, null is defaultminDaysInFirstWeek
- minimum number of days in first week of the year; default is 4private java.lang.Object readResolve()
public Chronology withUTC()
withUTC
in class BaseChronology
public Chronology withZone(DateTimeZone zone)
withZone
in class BaseChronology
zone
- the zone to get the chronology in, null is defaultZonedChronology
long getDateMidnightMillis(int year, int monthOfYear, int dayOfMonth) throws java.lang.IllegalArgumentException
BasicChronology
getDateMidnightMillis
in class BasicChronology
year
- the yearmonthOfYear
- the monthdayOfMonth
- the dayjava.lang.IllegalArgumentException
boolean isLeapYear(int year)
BasicChronology
isLeapYear
in class BasicChronology
year
- the year to testlong calculateFirstDayOfYearMillis(int year)
BasicChronology
calculateFirstDayOfYearMillis
in class BasicChronology
int getMinYear()
BasicChronology
getMinYear
in class BasicChronology
int getMaxYear()
BasicChronology
getMaxYear
in class BasicChronology
long getAverageMillisPerYear()
BasicChronology
getAverageMillisPerYear
in class BasicChronology
long getAverageMillisPerYearDividedByTwo()
BasicChronology
getAverageMillisPerYearDividedByTwo
in class BasicChronology
long getAverageMillisPerMonth()
BasicChronology
getAverageMillisPerMonth
in class BasicChronology
long getApproxMillisAtEpochDividedByTwo()
BasicChronology
(yearAtEpoch * averageMillisPerYear + millisOfYearAtEpoch) / 2where epoch is 1970-01-01 (Gregorian).
getApproxMillisAtEpochDividedByTwo
in class BasicChronology
protected void assemble(AssembledChronology.Fields fields)
AssembledChronology
assemble
in class BasicChronology
fields
- container of fields