org.apache.myfaces.custom.schedule.model
Class HalfHourInterval

java.lang.Object
  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.

Since:
1.1.7
Version:
$Revision: 371736 $
Author:
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

HALF_HOUR

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

HalfHourInterval

public HalfHourInterval(Date startTime,
                        Date maxEnd)
Method Detail

next

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.

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


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