Class JulianChronology
- All Implemented Interfaces:
Serializable, Calendrical
JulianChronology defines the rules of the Julian calendar system. The Julian calendar was introduced by Julius Caesar in 46 BCE to replace the previous Roman calendar system.
The calendar system is the same as the ISOChronology ISO-8601 calendar
system with the exception of the rule for the leap year. The Julian definition
has a leap year every four years without fail.
JulianChronology is immutable and thread-safe.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classUnit class for months.private static final classUnit class for years. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JulianChronologyThe singleton instance ofJulianChronology.private static final PeriodUnitPeriod unit for months.private static final longThe serialization version.private static final PeriodUnitPeriod unit for years. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidcheckNotNull(Object object, String errorMessage) Validates that the input value is not null.getName()Gets the name of the chronology.static booleanisLeapYear(int year) Checks if the specified year is a leap year.static PeriodUnitGets the period unit for days.static PeriodUnitGets the period unit for months.static PeriodUnitGets the period unit for weeks.static PeriodUnitGets the period unit for years.private ObjectResolves singleton.Methods inherited from class Chronology
get, rule, toString
-
Field Details
-
INSTANCE
The singleton instance ofJulianChronology. -
serialVersionUID
private static final long serialVersionUIDThe serialization version.- See Also:
-
YEARS
Period unit for years. -
MONTHS
Period unit for months.
-
-
Constructor Details
-
JulianChronology
private JulianChronology()Restrictive constructor.
-
-
Method Details
-
readResolve
-
checkNotNull
Validates that the input value is not null.- Parameters:
object- the object to checkerrorMessage- the error to throw- Throws:
NullPointerException- if the object is null
-
isLeapYear
public static boolean isLeapYear(int year) Checks if the specified year is a leap year.The Julian calendar system defines a leap year as being divisible by four without remainder. The calculation is proleptic - applying the same rules into the far future and far past.
- Parameters:
year- the year to check, not validated for range- Returns:
- true if the year is a leap year
-
getName
Gets the name of the chronology.- Specified by:
getNamein classChronology- Returns:
- the name of the chronology, never null
-
periodYears
Gets the period unit for years.The period unit defines the concept of a period of a year in the Julian calendar system. This has an estimated duration equal to 365.25 days.
See
for the main date-time field.invalid reference
#yearRule()- Returns:
- the period unit for years, never null
-
periodMonths
Gets the period unit for months.The period unit defines the concept of a period of a month in the Julian calendar system. This has an estimated duration equal to one-twelfth of 365.25 days.
See
for the main date-time field.invalid reference
#monthOfYearRule()- Returns:
- the period unit for months, never null
-
periodWeeks
Gets the period unit for weeks.The period unit defines the concept of a period of a week. This is equivalent to the ISO weeks period unit.
- Returns:
- the period unit for weeks, never null
-
periodDays
Gets the period unit for days.The period unit defines the concept of a period of a day. This is equivalent to the ISO days period unit.
See
for the main date-time field.invalid reference
#dayOfMonthRule()- Returns:
- the period unit for days, never null
-