ch.qos.logback.core.rolling.helper

## Class RollingCalendar

- java.lang.Object
- - java.util.Calendar
  - - java.util.GregorianCalendar
    - - ch.qos.logback.core.rolling.helper.RollingCalendar

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.Calendar>

    public class RollingCalendar
    extends java.util.GregorianCalendar

RollingCalendar is a helper class to `TimeBasedRollingPolicy` or similar timed-based rolling policies. Given a periodicity type and the current time, it computes the start of the next interval (i.e. the triggering date).

Author:
  Ceki Gülcü
See Also:
  Serialized Form

### Field Summary

### Fields inherited from class java.util.GregorianCalendar

`AD, BC`

### Fields inherited from class java.util.Calendar

`ALL_STYLES, AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, LONG, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET`

### Constructor Summary

Constructors
Constructor and Description
`RollingCalendar()`
`RollingCalendar(java.util.TimeZone tz, java.util.Locale locale)`

### Method Summary

Methods
`PeriodicityType` `computePeriodicityType(java.lang.String datePattern)`
`static int` `diffInMonths(long startTime, long endTime)`
`java.util.Date` `getNextTriggeringDate(java.util.Date now)`
`long` `getNextTriggeringMillis(java.util.Date now)`
`PeriodicityType` `getPeriodicityType()`
`java.util.Date` `getRelativeDate(java.util.Date now, int periods)`
`void` `init(java.lang.String datePattern)`
`long` `periodsElapsed(long start, long end)`
`void` `printPeriodicity(ContextAwareBase cab)`

### Methods inherited from class java.util.GregorianCalendar

`add, clone, computeFields, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, getWeeksInWeekYear, getWeekYear, hashCode, isLeapYear, isWeekDateSupported, roll, roll, setGregorianChange, setTimeZone, setWeekDate`

### Methods inherited from class java.util.Calendar

`after, before, clear, clear, compareTo, complete, get, getAvailableLocales, getDisplayName, getDisplayNames, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, toString`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### RollingCalendar

    public RollingCalendar()

#### RollingCalendar

    public RollingCalendar(java.util.TimeZone tz,
                   java.util.Locale locale)

### Method Detail

#### init

    public void init(java.lang.String datePattern)

#### getPeriodicityType

    public PeriodicityType getPeriodicityType()

#### getNextTriggeringMillis

    public long getNextTriggeringMillis(java.util.Date now)

#### computePeriodicityType

    public PeriodicityType computePeriodicityType(java.lang.String datePattern)

#### printPeriodicity

    public void printPeriodicity(ContextAwareBase cab)

#### periodsElapsed

    public long periodsElapsed(long start,
                      long end)

#### diffInMonths

    public static int diffInMonths(long startTime,
                   long endTime)

#### getRelativeDate

    public java.util.Date getRelativeDate(java.util.Date now,
                                 int periods)

#### getNextTriggeringDate

    public java.util.Date getNextTriggeringDate(java.util.Date now)