Class HalfHourInterval

  extended by org.apache.myfaces.custom.schedule.model.Interval
      extended by org.apache.myfaces.custom.schedule.model.HalfHourInterval
All Implemented Interfaces:
Serializable, Comparable

public class HalfHourInterval
extends Interval

This class represents an interval of up to half an hour. The interval will always round up to the next half hour e.g. a start time of 14:15 will generate an interval with end time of 14:30.

$Revision: 371736 $
Peter Mahoney
See Also:
Serialized Form

Field Summary
static long HALF_HOUR
Constructor Summary
HalfHourInterval(Date startTime, Date maxEnd)
Method Summary
static Interval next(Interval interval, Date maxEnd)
          Create a new half hour interval following on from the supplied interval.
Methods inherited from class org.apache.myfaces.custom.schedule.model.Interval
after, compareTo, containsDate, equals, getDuration, getEndTime, getLabel, getStartHours, getStartMinutes, getStartTime, hashCode, isEquivalent, setEndTime, setLabel, setStartTime, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail


public static final long HALF_HOUR
See Also:
Constant Field Values
Constructor Detail


public HalfHourInterval(Date startTime,
                        Date maxEnd)
Method Detail


public static Interval next(Interval interval,
                            Date maxEnd)
Create a new half hour interval following on from the supplied interval. The interval will be anything up to half an hour, depending on when the end of the previous interval was. If an interval cannot be fitted between the end of the last interval and the maximum end time, null will be returned.

interval - The previous interval
maxEnd - The maximum end time of the new interval
The next half hour interval

Copyright © 2012 The Apache Software Foundation. All Rights Reserved.