Class FixedYearVariableMonthChronology
- java.lang.Object
-
- org.joda.time.Chronology
-
- org.joda.time.chrono.BaseChronology
-
- uk.ac.rdg.resc.edal.util.chronologies.FixedYearVariableMonthChronology
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AllLeapChronology
,NoLeapChronology
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 UTC. (Support for time zones makes little sense in this chronology).
Instances of this class are immutable.
- Author:
- Jon
- See Also:
- CF conventions, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FixedYearVariableMonthChronology(int[] monthLengths)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 savinglong
getAverageMillisInMonth()
Gets the average number of milliseconds in each monthint[]
getMonthLengths()
Gets the length of each month in days.org.joda.time.DateTimeZone
getZone()
Always returns UTCorg.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()
String
toString()
org.joda.time.DurationField
weeks()
Each week has 7 daysorg.joda.time.Chronology
withUTC()
Returns this objectorg.joda.time.Chronology
withZone(org.joda.time.DateTimeZone zone)
Throws UnsupportedOperationException unless the time zone is UTCorg.joda.time.DateTimeField
year()
org.joda.time.DateTimeField
yearOfCentury()
org.joda.time.DurationField
years()
-
-
-
Constructor Detail
-
FixedYearVariableMonthChronology
public FixedYearVariableMonthChronology(int[] monthLengths)
- Parameters:
monthLengths
- The number of days in each month- Throws:
NullPointerException
- if monthLengths is nullIllegalArgumentException
- if monthLengths is empty or contains zero or negative values.
-
-
Method Detail
-
dayOfMonth
public final org.joda.time.DateTimeField dayOfMonth()
-
monthOfYear
public final org.joda.time.DateTimeField monthOfYear()
-
months
public final org.joda.time.DurationField months()
-
getMonthLengths
public int[] getMonthLengths()
Gets the length of each month in days. Returns a new array with each invocation to maintain integrity of internal data.
-
getAverageMillisInMonth
public long getAverageMillisInMonth()
Gets the average number of milliseconds in each month
-
toString
public String toString()
- Specified by:
toString
in classorg.joda.time.chrono.BaseChronology
-
millis
public final org.joda.time.DurationField millis()
- Overrides:
millis
in classorg.joda.time.chrono.BaseChronology
-
seconds
public final org.joda.time.DurationField seconds()
- Overrides:
seconds
in classorg.joda.time.chrono.BaseChronology
-
minutes
public final org.joda.time.DurationField minutes()
- Overrides:
minutes
in classorg.joda.time.chrono.BaseChronology
-
hours
public final org.joda.time.DurationField hours()
- Overrides:
hours
in classorg.joda.time.chrono.BaseChronology
-
halfdays
public final org.joda.time.DurationField halfdays()
- Overrides:
halfdays
in classorg.joda.time.chrono.BaseChronology
-
days
public final org.joda.time.DurationField days()
Each day has exactly the same length: there is no daylight saving- Overrides:
days
in classorg.joda.time.chrono.BaseChronology
-
weeks
public final org.joda.time.DurationField weeks()
Each week has 7 days- Overrides:
weeks
in classorg.joda.time.chrono.BaseChronology
-
years
public final org.joda.time.DurationField years()
- Overrides:
years
in classorg.joda.time.chrono.BaseChronology
-
centuries
public final org.joda.time.DurationField centuries()
- Overrides:
centuries
in classorg.joda.time.chrono.BaseChronology
-
millisOfSecond
public final org.joda.time.DateTimeField millisOfSecond()
- Overrides:
millisOfSecond
in classorg.joda.time.chrono.BaseChronology
-
millisOfDay
public final org.joda.time.DateTimeField millisOfDay()
- Overrides:
millisOfDay
in classorg.joda.time.chrono.BaseChronology
-
secondOfMinute
public final org.joda.time.DateTimeField secondOfMinute()
- Overrides:
secondOfMinute
in classorg.joda.time.chrono.BaseChronology
-
secondOfDay
public final org.joda.time.DateTimeField secondOfDay()
- Overrides:
secondOfDay
in classorg.joda.time.chrono.BaseChronology
-
minuteOfHour
public final org.joda.time.DateTimeField minuteOfHour()
- Overrides:
minuteOfHour
in classorg.joda.time.chrono.BaseChronology
-
minuteOfDay
public final org.joda.time.DateTimeField minuteOfDay()
- Overrides:
minuteOfDay
in classorg.joda.time.chrono.BaseChronology
-
hourOfDay
public final org.joda.time.DateTimeField hourOfDay()
- Overrides:
hourOfDay
in classorg.joda.time.chrono.BaseChronology
-
hourOfHalfday
public final org.joda.time.DateTimeField hourOfHalfday()
- Overrides:
hourOfHalfday
in classorg.joda.time.chrono.BaseChronology
-
halfdayOfDay
public final org.joda.time.DateTimeField halfdayOfDay()
- Overrides:
halfdayOfDay
in classorg.joda.time.chrono.BaseChronology
-
clockhourOfDay
public final org.joda.time.DateTimeField clockhourOfDay()
- Overrides:
clockhourOfDay
in classorg.joda.time.chrono.BaseChronology
-
clockhourOfHalfday
public final org.joda.time.DateTimeField clockhourOfHalfday()
- Overrides:
clockhourOfHalfday
in classorg.joda.time.chrono.BaseChronology
-
dayOfWeek
public final org.joda.time.DateTimeField dayOfWeek()
- Overrides:
dayOfWeek
in classorg.joda.time.chrono.BaseChronology
-
dayOfYear
public final org.joda.time.DateTimeField dayOfYear()
- Overrides:
dayOfYear
in classorg.joda.time.chrono.BaseChronology
-
year
public final org.joda.time.DateTimeField year()
- Overrides:
year
in classorg.joda.time.chrono.BaseChronology
-
yearOfCentury
public final org.joda.time.DateTimeField yearOfCentury()
- Overrides:
yearOfCentury
in classorg.joda.time.chrono.BaseChronology
-
getZone
public final org.joda.time.DateTimeZone getZone()
Always returns UTC- Specified by:
getZone
in classorg.joda.time.chrono.BaseChronology
-
withZone
public final org.joda.time.Chronology withZone(org.joda.time.DateTimeZone zone)
Throws UnsupportedOperationException unless the time zone is UTC- Specified by:
withZone
in classorg.joda.time.chrono.BaseChronology
-
withUTC
public final org.joda.time.Chronology withUTC()
Returns this object- Specified by:
withUTC
in classorg.joda.time.chrono.BaseChronology
-
-