Class RollingCalendar

java.lang.Object
java.util.Calendar
java.util.GregorianCalendar
ch.qos.logback.core.rolling.helper.RollingCalendar
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Calendar>

public class RollingCalendar extends 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).
See Also:
  • Field Details

  • Constructor Details

    • RollingCalendar

      public RollingCalendar(String datePattern)
    • RollingCalendar

      public RollingCalendar(String datePattern, TimeZone tz, Locale locale)
  • Method Details

    • getPeriodicityType

      public PeriodicityType getPeriodicityType()
    • computePeriodicityType

      public PeriodicityType computePeriodicityType()
    • isCollisionFree

      public boolean isCollisionFree()
    • collision

      private boolean collision(long delta)
    • printPeriodicity

      public void printPeriodicity(ContextAwareBase cab)
    • periodBarriersCrossed

      public long periodBarriersCrossed(long start, long end)
    • diffInMonths

      public static int diffInMonths(long startTime, long endTime)
    • innerGetEndOfThisPeriod

      private static Date innerGetEndOfThisPeriod(Calendar cal, PeriodicityType periodicityType, Date now)
    • innerGetEndOfNextNthPeriod

      private static Date innerGetEndOfNextNthPeriod(Calendar cal, PeriodicityType periodicityType, Date now, int numPeriods)
    • getEndOfNextNthPeriod

      public Date getEndOfNextNthPeriod(Date now, int periods)
    • getNextTriggeringDate

      public Date getNextTriggeringDate(Date now)
    • getStartOfCurrentPeriodWithGMTOffsetCorrection

      public long getStartOfCurrentPeriodWithGMTOffsetCorrection(long now, TimeZone timezone)