public class FixedYearVariableMonthChronology
extends org.joda.time.chrono.BaseChronology
A Chronology
in which each year has the same number of days but
the lengths of the months may be different. May be useful for climate and
palaeoclimate calendars.
In this Chronology, a millisecond instant of zero corresponds with 1970-01-01T00:00:00.000Z and a year has a fixed number of milliseconds.
There is no concept of an era in this calendar, so all durations and fields relating to this concept are not supported. Additionally, the concept of a "weekyear" (the year that "owns" a given week) is not implemented.
Instances of this class can only be created in "DateTimeZone#UTC". (Support for time zones makes little sense in this chronology).
Instances of this class are immutable.
Constructor and Description |
---|
FixedYearVariableMonthChronology(int[] monthLengths) |
Modifier and Type | Method and Description |
---|---|
org.joda.time.DurationField |
centuries() |
org.joda.time.DateTimeField |
clockhourOfDay() |
org.joda.time.DateTimeField |
clockhourOfHalfday() |
org.joda.time.DateTimeField |
dayOfMonth() |
org.joda.time.DateTimeField |
dayOfWeek() |
org.joda.time.DateTimeField |
dayOfYear() |
org.joda.time.DurationField |
days()
Each day has exactly the same length: there is no daylight saving
|
long |
getAverageMillisInMonth()
Gets the average number of milliseconds in each month
|
int[] |
getMonthLengths()
Gets the length of each month in days.
|
org.joda.time.DateTimeZone |
getZone()
Always returns UTC
|
org.joda.time.DateTimeField |
halfdayOfDay() |
org.joda.time.DurationField |
halfdays() |
org.joda.time.DateTimeField |
hourOfDay() |
org.joda.time.DateTimeField |
hourOfHalfday() |
org.joda.time.DurationField |
hours() |
org.joda.time.DurationField |
millis() |
org.joda.time.DateTimeField |
millisOfDay() |
org.joda.time.DateTimeField |
millisOfSecond() |
org.joda.time.DateTimeField |
minuteOfDay() |
org.joda.time.DateTimeField |
minuteOfHour() |
org.joda.time.DurationField |
minutes() |
org.joda.time.DateTimeField |
monthOfYear() |
org.joda.time.DurationField |
months() |
org.joda.time.DateTimeField |
secondOfDay() |
org.joda.time.DateTimeField |
secondOfMinute() |
org.joda.time.DurationField |
seconds() |
java.lang.String |
toString() |
org.joda.time.DurationField |
weeks()
Each week has 7 days
|
org.joda.time.Chronology |
withUTC()
Returns this object
|
org.joda.time.Chronology |
withZone(org.joda.time.DateTimeZone zone)
Throws UnsupportedOperationException unless the time zone is UTC
|
org.joda.time.DateTimeField |
year() |
org.joda.time.DateTimeField |
yearOfCentury() |
org.joda.time.DurationField |
years() |
public FixedYearVariableMonthChronology(int[] monthLengths)
monthLengths
- The number of days in each monthjava.lang.NullPointerException
- if monthLengths is nulljava.lang.IllegalArgumentException
- if monthLengths is empty or contains
zero or negative values.public final org.joda.time.DateTimeField dayOfMonth()
public final org.joda.time.DateTimeField monthOfYear()
public final org.joda.time.DurationField months()
public int[] getMonthLengths()
public long getAverageMillisInMonth()
public java.lang.String toString()
toString
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField millis()
millis
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField seconds()
seconds
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField minutes()
minutes
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField hours()
hours
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField halfdays()
halfdays
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField days()
days
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField weeks()
weeks
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField years()
years
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DurationField centuries()
centuries
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField millisOfSecond()
millisOfSecond
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField millisOfDay()
millisOfDay
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField secondOfMinute()
secondOfMinute
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField secondOfDay()
secondOfDay
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField minuteOfHour()
minuteOfHour
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField minuteOfDay()
minuteOfDay
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField hourOfDay()
hourOfDay
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField hourOfHalfday()
hourOfHalfday
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField halfdayOfDay()
halfdayOfDay
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField clockhourOfDay()
clockhourOfDay
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField clockhourOfHalfday()
clockhourOfHalfday
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField dayOfWeek()
dayOfWeek
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField dayOfYear()
dayOfYear
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField year()
year
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeField yearOfCentury()
yearOfCentury
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.DateTimeZone getZone()
getZone
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.Chronology withZone(org.joda.time.DateTimeZone zone)
withZone
in class org.joda.time.chrono.BaseChronology
public final org.joda.time.Chronology withUTC()
withUTC
in class org.joda.time.chrono.BaseChronology