Class JulianChronology
- java.lang.Object
-
- javax.time.calendar.Chronology
-
- javax.time.i18n.JulianChronology
-
- All Implemented Interfaces:
java.io.Serializable
,Calendrical
public final class JulianChronology extends Chronology implements java.io.Serializable
The Julian calendar system.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JulianChronology.Months
Unit class for months.private static class
JulianChronology.Years
Unit class for years.
-
Field Summary
Fields Modifier and Type Field Description static JulianChronology
INSTANCE
The singleton instance ofJulianChronology
.private static PeriodUnit
MONTHS
Period unit for months.private static long
serialVersionUID
The serialization version.private static PeriodUnit
YEARS
Period unit for years.
-
Constructor Summary
Constructors Modifier Constructor Description private
JulianChronology()
Restrictive constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
checkNotNull(java.lang.Object object, java.lang.String errorMessage)
Validates that the input value is not null.java.lang.String
getName()
Gets the name of the chronology.static boolean
isLeapYear(int year)
Checks if the specified year is a leap year.static PeriodUnit
periodDays()
Gets the period unit for days.static PeriodUnit
periodMonths()
Gets the period unit for months.static PeriodUnit
periodWeeks()
Gets the period unit for weeks.static PeriodUnit
periodYears()
Gets the period unit for years.private java.lang.Object
readResolve()
Resolves singleton.-
Methods inherited from class javax.time.calendar.Chronology
get, rule, toString
-
-
-
-
Field Detail
-
INSTANCE
public static final JulianChronology INSTANCE
The singleton instance ofJulianChronology
.
-
serialVersionUID
private static final long serialVersionUID
The serialization version.- See Also:
- Constant Field Values
-
YEARS
private static final PeriodUnit YEARS
Period unit for years.
-
MONTHS
private static final PeriodUnit MONTHS
Period unit for months.
-
-
Method Detail
-
readResolve
private java.lang.Object readResolve()
Resolves singleton.- Returns:
- the singleton instance
-
checkNotNull
static void checkNotNull(java.lang.Object object, java.lang.String errorMessage)
Validates that the input value is not null.- Parameters:
object
- the object to checkerrorMessage
- the error to throw- Throws:
java.lang.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
public java.lang.String getName()
Gets the name of the chronology.- Specified by:
getName
in classChronology
- Returns:
- the name of the chronology, never null
-
periodYears
public static PeriodUnit 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
#yearRule()
for the main date-time field.- Returns:
- the period unit for years, never null
-
periodMonths
public static PeriodUnit 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
#monthOfYearRule()
for the main date-time field.- Returns:
- the period unit for months, never null
-
periodWeeks
public static PeriodUnit 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
public static PeriodUnit 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
#dayOfMonthRule()
for the main date-time field.- Returns:
- the period unit for days, never null
-
-