|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectscheduler.generate.FindTime
public class FindTime
FindTime supports the generation algorithm. This class reviews input and determines of a list of ideal times to schedule a course.
| Field Summary | |
|---|---|
private static Time |
endTime
Temporary holder for start Times |
private static Time |
startTime
Temporary holder for start Times |
private static java.util.LinkedHashMap<Time,Time> |
timehash
LinkedHashMap to store return times |
private static TimePreferenceComparator |
timePrefComparator
Comparator used to sort TimePreferences |
private static java.util.ArrayList<TimePreference> |
timeprefs
List of TimePreferences |
| Constructor Summary | |
|---|---|
FindTime()
|
|
| Method Summary | |
|---|---|
static java.util.LinkedHashMap<Time,Time> |
findIdealTime(Instructor instructor,
Course course)
Finds a suitable time to apply to section |
static boolean |
timeWorks(Instructor instructor,
Time startTime,
Time endTime)
Checks if a Time works for enough days |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static TimePreferenceComparator timePrefComparator
private static java.util.ArrayList<TimePreference> timeprefs
private static java.util.LinkedHashMap<Time,Time> timehash
private static Time startTime
private static Time endTime
| Constructor Detail |
|---|
public FindTime()
| Method Detail |
|---|
public static java.util.LinkedHashMap<Time,Time> findIdealTime(Instructor instructor,
Course course)
i - The instructor to use in searchc - The course that is being used to search for a time
// ** Pre and Post conditions ** // Pre: // Instructor value can not be null i != nil && // Course value can not be null c != nil && //Instructor must be in the instructor database db.instructorDB.isValidInstructor(i) && // Course must be in the course database db.coursedb.isValidCourse(c) Post: //The returned time must not conflict with instructors teaching times db.instructorDB.isValidTime(instructor,time) && //The returned time must not violate any schedule attributes scheduler.isValidTime(time)
public static boolean timeWorks(Instructor instructor,
Time startTime,
Time endTime)
i - The instructor to use in searchs - The start timee - The end time
// ** Pre and Post conditions ** // Pre: // Instructor value can not be null i != nil && // startTime can not be null s != nil && // endTime can not be null e != nil Post:
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||