Class 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 {@link "DateTimeZone#UTC"}. (Support for time zones makes little sense in this chronology).

    Instances of this class are immutable.

    See Also:
    "http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.4/cf-conventions.html#calendar", Serialized Form
    • Constructor Detail

      • FixedYearVariableMonthChronology

        public FixedYearVariableMonthChronology​(int[] monthLengths)
        Parameters:
        monthLengths - The number of days in each month
        Throws:
        NullPointerException - if monthLengths is null
        IllegalArgumentException - 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. TODO return an immutable List
      • getAverageMillisInMonth

        public long getAverageMillisInMonth()
        Gets the average number of milliseconds in each month
      • toString

        public String toString()
        Specified by:
        toString in class org.joda.time.chrono.BaseChronology
      • millis

        public final org.joda.time.DurationField millis()
        Overrides:
        millis in class org.joda.time.chrono.BaseChronology
      • seconds

        public final org.joda.time.DurationField seconds()
        Overrides:
        seconds in class org.joda.time.chrono.BaseChronology
      • minutes

        public final org.joda.time.DurationField minutes()
        Overrides:
        minutes in class org.joda.time.chrono.BaseChronology
      • hours

        public final org.joda.time.DurationField hours()
        Overrides:
        hours in class org.joda.time.chrono.BaseChronology
      • halfdays

        public final org.joda.time.DurationField halfdays()
        Overrides:
        halfdays in class org.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 class org.joda.time.chrono.BaseChronology
      • weeks

        public final org.joda.time.DurationField weeks()
        Each week has 7 days
        Overrides:
        weeks in class org.joda.time.chrono.BaseChronology
      • years

        public final org.joda.time.DurationField years()
        Overrides:
        years in class org.joda.time.chrono.BaseChronology
      • centuries

        public final org.joda.time.DurationField centuries()
        Overrides:
        centuries in class org.joda.time.chrono.BaseChronology
      • millisOfSecond

        public final org.joda.time.DateTimeField millisOfSecond()
        Overrides:
        millisOfSecond in class org.joda.time.chrono.BaseChronology
      • millisOfDay

        public final org.joda.time.DateTimeField millisOfDay()
        Overrides:
        millisOfDay in class org.joda.time.chrono.BaseChronology
      • secondOfMinute

        public final org.joda.time.DateTimeField secondOfMinute()
        Overrides:
        secondOfMinute in class org.joda.time.chrono.BaseChronology
      • secondOfDay

        public final org.joda.time.DateTimeField secondOfDay()
        Overrides:
        secondOfDay in class org.joda.time.chrono.BaseChronology
      • minuteOfHour

        public final org.joda.time.DateTimeField minuteOfHour()
        Overrides:
        minuteOfHour in class org.joda.time.chrono.BaseChronology
      • minuteOfDay

        public final org.joda.time.DateTimeField minuteOfDay()
        Overrides:
        minuteOfDay in class org.joda.time.chrono.BaseChronology
      • hourOfDay

        public final org.joda.time.DateTimeField hourOfDay()
        Overrides:
        hourOfDay in class org.joda.time.chrono.BaseChronology
      • hourOfHalfday

        public final org.joda.time.DateTimeField hourOfHalfday()
        Overrides:
        hourOfHalfday in class org.joda.time.chrono.BaseChronology
      • halfdayOfDay

        public final org.joda.time.DateTimeField halfdayOfDay()
        Overrides:
        halfdayOfDay in class org.joda.time.chrono.BaseChronology
      • clockhourOfDay

        public final org.joda.time.DateTimeField clockhourOfDay()
        Overrides:
        clockhourOfDay in class org.joda.time.chrono.BaseChronology
      • clockhourOfHalfday

        public final org.joda.time.DateTimeField clockhourOfHalfday()
        Overrides:
        clockhourOfHalfday in class org.joda.time.chrono.BaseChronology
      • dayOfWeek

        public final org.joda.time.DateTimeField dayOfWeek()
        Overrides:
        dayOfWeek in class org.joda.time.chrono.BaseChronology
      • dayOfYear

        public final org.joda.time.DateTimeField dayOfYear()
        Overrides:
        dayOfYear in class org.joda.time.chrono.BaseChronology
      • year

        public final org.joda.time.DateTimeField year()
        Overrides:
        year in class org.joda.time.chrono.BaseChronology
      • yearOfCentury

        public final org.joda.time.DateTimeField yearOfCentury()
        Overrides:
        yearOfCentury in class org.joda.time.chrono.BaseChronology
      • getZone

        public final org.joda.time.DateTimeZone getZone()
        Always returns UTC
        Specified by:
        getZone in class org.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 class org.joda.time.chrono.BaseChronology
      • withUTC

        public final org.joda.time.Chronology withUTC()
        Returns this object
        Specified by:
        withUTC in class org.joda.time.chrono.BaseChronology