com.gmscheduler.model
Class ScheduleUtil

java.lang.Object
  extended by com.gmscheduler.model.ScheduleUtil

public class ScheduleUtil
extends java.lang.Object

The Schedule Utility is the buisness logic for parsing schedules as well as finding busy times. The utility has two methods parseSchedule, which takes a preformatted string and returns a schedule, and findTime which takes a constraint schedule and a linkedlist of busy time schedules.

See Also:
Timeframe, Schedule

Constructor Summary
ScheduleUtil()
           
 
Method Summary
 Schedule findTime(Schedule freetime, java.util.LinkedList schedules)
          Finds the remaining free time from the free time constraint compared against the busy time of all schedules.
 Schedule parseSchedule(java.lang.String str)
          This method simply takes in the big list of times and days, breaks them apart and sends them to the parse method which handles the actual parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduleUtil

public ScheduleUtil()
Method Detail

parseSchedule

public Schedule parseSchedule(java.lang.String str)
This method simply takes in the big list of times and days, breaks them apart and sends them to the parse method which handles the actual parsing. The results of the parse method are then added to a schedule object which is returned.

Parameters:
str - is the big long list of times that a user submits.
Returns:
a schedule object containing the parsed times from the string.

findTime

public Schedule findTime(Schedule freetime,
                         java.util.LinkedList schedules)
Finds the remaining free time from the free time constraint compared against the busy time of all schedules.

Parameters:
freetime - The original non-busy time in which to constrain all other busy times.
schedules - A linked list of Schedules that are busy time.
Returns:
A schedule of free time constrained by the original free time and the list of busy schedules.