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

java.lang.Object
  extended by org.apache.myfaces.custom.schedule.model.Day
      extended by org.apache.myfaces.custom.schedule.model.ScheduleDay
All Implemented Interfaces:
Serializable, Comparable

public class ScheduleDay
extends Day
implements Serializable, Comparable

This class represents one day in the schedule component

Version:
$Revision: 371736 $
Author:
Jurgen Lust (latest modification by $Author: werpu $)
See Also:
Serialized Form

Constructor Summary
ScheduleDay(Date date)
          Creates a new ScheduleDay object.
ScheduleDay(Date date, TimeZone tz)
          Creates a new ScheduleDay object.
 
Method Summary
 boolean addEntry(ScheduleEntry entry)
           Add an entry to this day
 void clear()
           Remove all entries from this day
 int getFirstEventHour()
          Get the inclusive hour in which the first event on this day starts.
 Interval getInterval(Date clickedDate)
           
 List getIntervals(int startHour, int endHour)
          Get an chronologically ordered list of intervals during the day.
 int getLastEventHour()
          Get the non-inclusive hour by which all events on this day have completed.
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(ScheduleEntry entry)
           Remove an entry from this day
 int size()
           
 
Methods inherited from class org.apache.myfaces.custom.schedule.model.Day
addInterval, compareTo, equals, equalsDate, getCalendarInstance, getDate, getDayEnd, getDayStart, getIntervals, getSpecialDayName, hashCode, isWorkingDay, setIntervals, setSpecialDayName, setWorkingDay
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

ScheduleDay

public ScheduleDay(Date date)
Creates a new ScheduleDay object.

Parameters:
date - the date

ScheduleDay

public ScheduleDay(Date date,
                   TimeZone tz)
Creates a new ScheduleDay object.

Parameters:
date - the date
Method Detail

isEmpty

public boolean isEmpty()
Returns:
true if there are no schedule entries

addEntry

public boolean addEntry(ScheduleEntry entry)

Add an entry to this day

Parameters:
entry - the entry to add
Returns:
true if successful

clear

public void clear()

Remove all entries from this day


iterator

public Iterator iterator()
Returns:
an iterator for the schedule entries of this day

remove

public boolean remove(ScheduleEntry entry)

Remove an entry from this day

Parameters:
entry - the entry to remove
Returns:
true if successful

size

public int size()
Returns:
the number of entries that are shown on this day

getLastEventHour

public int getLastEventHour()
Get the non-inclusive hour by which all events on this day have completed. All day events are not included, as their end time is implicit.

Returns:
From 0, where there are no events and 24 where events exist up to the last hour

getFirstEventHour

public int getFirstEventHour()
Get the inclusive hour in which the first event on this day starts. All day events are not included, as their start time is implicit.

Returns:
From 0, where there is an event in the first hour to 24 where there are no events

getInterval

public Interval getInterval(Date clickedDate)

getIntervals

public List getIntervals(int startHour,
                         int endHour)
Get an chronologically ordered list of intervals during the day. These will consist of user defined intervals, packed with half hour intervals to ensure contiguous intervals between the start and end hour.

Parameters:
startHour - The first hour
endHour - The last hour
Returns:
A List of intervals covering the day


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