|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.example.model.Schedule
public class Schedule
A Schedule object takes a set of restraint times along the busy times for a group and returns the free times common to all members of the group that fall within the restraints. The object contains a list of TimeInterval objects for each day Monday-Friday which store the free times for each day.
| Constructor Summary | |
|---|---|
Schedule()
|
|
| Method Summary | |
|---|---|
void |
addBusyTimesToList(TimeInterval interval,
java.util.List<TimeInterval> dayList)
Adds a busy time TimeInterval to a list of intervals for a particular day. |
void |
addFreeTimesToList(TimeInterval interval,
java.util.List<TimeInterval> dayList)
Adds a free time TimeInterval to a list of intervals for a particular day. |
java.lang.String |
combine(java.util.List<TimeInterval> dayList,
char day)
Takes a list of intervals for a particular day, the character symbol for that day, and combines the free times in that list into a string which gets returned. |
java.lang.String |
getFreeTimes()
Creates a String representation of the free times for each day, combines those strings into one all-encompassing string and returns it. |
int |
getMinFreeTimeSpan()
Return the minimum time span for an interval to be considered valid free time. |
int |
getTime(java.lang.String time)
Takes a time that was parsed from the original string, and returns that time as an integer in universal time, to be used in a TimeInterval object. |
void |
setBusyTimes(java.lang.String times)
Parses a string of the form "MW 9:00 AM-11:15 AM, T 12:25 PM - 4:00 PM", containing a set of busy times for the schedule object. |
void |
setFreeTimeConstraints(java.lang.String times)
Parses a string of the form "MW 9:00 AM-11:15 AM, T 12:25 PM - 4:00 PM", containing the free time constraints for the schedule object. |
void |
setMinFreeTimeSpan(java.lang.String span)
Set the minimum time span for an interval to be considered valid free time. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Schedule()
| Method Detail |
|---|
public void setFreeTimeConstraints(java.lang.String times)
throws FreeTimesAlreadySetException
times - A string containing a list of free times and during which days
those times occur.
FreeTimesAlreadySetException
public void setBusyTimes(java.lang.String times)
throws FreeTimesNotSetException
times - A string containing a list of busy times and during which days
those times occur.
FreeTimesNotSetExceptionpublic int getTime(java.lang.String time)
time - A String representing a particular time.
public void addFreeTimesToList(TimeInterval interval,
java.util.List<TimeInterval> dayList)
throws FreeTimesAlreadySetException
interval - A TimeInterval that is to be added to a particular list.dayList - A list of TimeIntervals to which interval is to be added.
FreeTimesAlreadySetException
public void addBusyTimesToList(TimeInterval interval,
java.util.List<TimeInterval> dayList)
throws FreeTimesNotSetException
interval - A TimeInterval that is to be added to a particular list.dayList - A list of TimeIntervals to which interval to be added.
FreeTimesNotSetExceptionpublic java.lang.String getFreeTimes()
public java.lang.String combine(java.util.List<TimeInterval> dayList,
char day)
dayList - A list of TimeIntervals which is to be combined into a string.day - The day on which the times in dayList occur.
public void setMinFreeTimeSpan(java.lang.String span)
span - String representation of the spanning time.public int getMinFreeTimeSpan()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||