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

java.lang.Object
  extended byorg.apache.myfaces.custom.schedule.model.AbstractScheduleModel
      extended byorg.apache.myfaces.custom.schedule.model.SimpleScheduleModel
All Implemented Interfaces:
ScheduleModel, java.io.Serializable

public class SimpleScheduleModel
extends AbstractScheduleModel
implements java.io.Serializable

A simple implementation of the ScheduleModel, not backed by any kind of datasource: entries have to be added manually.

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

Field Summary
 
Fields inherited from class org.apache.myfaces.custom.schedule.model.AbstractScheduleModel
days
 
Fields inherited from interface org.apache.myfaces.custom.schedule.model.ScheduleModel
DAY, MONTH, WEEK, WORKWEEK
 
Constructor Summary
SimpleScheduleModel()
          Creates a new SimpleScheduleModel object.
 
Method Summary
 void addEntry(ScheduleEntry entry)
           Add an entry to the model
protected  void loadDayAttributes(Day day)
           Load any attributes for this day: is it a working day or a holiday, and what is the name of the day (e.g.
protected  java.util.Collection loadEntries(java.util.Date startDate, java.util.Date endDate)
           Load the schedule entries that fall between the startDate and the endDate.
 void removeEntry(ScheduleEntry entry)
           Remove an entry from the model
 void setHoliday(java.util.Date date, java.lang.String holidayName)
           Set the name of a holiday
 
Methods inherited from class org.apache.myfaces.custom.schedule.model.AbstractScheduleModel
add, clear, containsDate, get, getMode, getSelectedDate, getSelectedEntry, isEmpty, iterator, refresh, setDay, setMode, setMonth, setSelectedDate, setSelectedEntry, setWeek, setWorkWeek, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleScheduleModel

public SimpleScheduleModel()
Creates a new SimpleScheduleModel object.

Method Detail

setHoliday

public void setHoliday(java.util.Date date,
                       java.lang.String holidayName)

Set the name of a holiday

Parameters:
date - the date
holidayName - the name of the holiday
Returns:
true if successful

addEntry

public void addEntry(ScheduleEntry entry)

Add an entry to the model

Parameters:
entry - the entry to add

removeEntry

public void removeEntry(ScheduleEntry entry)

Remove an entry from the model

Parameters:
entry - the entry to remove

loadEntries

protected java.util.Collection loadEntries(java.util.Date startDate,
                                           java.util.Date endDate)
Description copied from class: AbstractScheduleModel

Load the schedule entries that fall between the startDate and the endDate.

Specified by:
loadEntries in class AbstractScheduleModel
Parameters:
startDate - 0 AM on the start date
endDate - 12 PM on the end date
See Also:
AbstractScheduleModel.loadEntries(java.util.Date, java.util.Date)

loadDayAttributes

protected void loadDayAttributes(Day day)
Description copied from class: AbstractScheduleModel

Load any attributes for this day: is it a working day or a holiday, and what is the name of the day (e.g. "Christmas").

Specified by:
loadDayAttributes in class AbstractScheduleModel
Parameters:
day - the day that should be loaded
See Also:
AbstractScheduleModel.loadDayAttributes(org.apache.myfaces.custom.schedule.model.Day)