|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
application.Schedule
public class Schedule
The Schedule maintains the data for a particular Schedule being manipulated by the application. Uses Singleton model. When someone asks for it, the method will either create a new one or give the existing one.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_FILE_NAME
|
Fields inherited from interface resources.Constants |
---|
BUILDING, COURSE, COURSE_FIELD, COURSE_NUMBER, LASTNAME, NAME, PROF_DOUBLE_BOOKED, ROOM, ROOM_DOUBLE_BOOKED, SECTION_NUMBER |
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Fields inherited from interface java.awt.print.Pageable |
---|
UNKNOWN_NUMBER_OF_PAGES |
Method Summary | |
---|---|
void |
addBook(Textbook book)
|
void |
addClassroom(Classroom classroom)
Adds a Classroom to the document |
void |
addCourse(Course course)
Adds a Course to the document |
void |
addProfessor(Professor prof)
Adds an Professor to the document |
void |
addSchedCourse(SchedCourse schedCourse)
Adds a SchedCourse to the document |
void |
addTimeSlot(TimeSlot timeSlot)
Adds a TimeSlot to the document |
void |
changed()
|
void |
exportCsv(java.io.File outCsv)
Put the schedule in a file that can be read by Excel |
void |
findConflicts()
update the conflicts Vector |
java.util.ArrayList |
getBooks()
|
boolean |
getChanged()
|
java.util.ArrayList |
getClassrooms()
Gets the class rooms. |
java.util.ArrayList |
getConflicts()
Gets the Conflicts. |
java.util.ArrayList |
getCourses()
Gets the Courses. |
java.lang.String |
getDirectory()
|
int |
getNumberOfPages()
|
java.awt.print.PageFormat |
getPageFormat(int pageIndex)
|
java.awt.print.Printable |
getPrintable(int pageIndex)
|
java.util.ArrayList |
getProfessors()
Gets the instructors. |
java.util.ArrayList |
getSchedCourses()
Gets the Scheduled Courses. |
static Schedule |
getSchedule()
Allows access to the schedule to anyone who wants it without needing to pass it around as a parameter. |
java.lang.String |
getScheduleName()
|
Summary |
getSummary()
|
java.util.ArrayList |
getTimeSlots()
Gets the time slots. |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pageFormat,
int pageIndex)
Print some text schedcourses on each page |
void |
removeBook(Textbook book)
|
void |
removeClassroom(Classroom classroom)
Removes a Classroom from the document |
void |
removeCourse(Course course)
Removes a Course from the document |
void |
removeProfessor(Professor prof)
Removes a Professor from the document |
void |
removeSchedCourse(SchedCourse schedCourse)
Removes a SchedCourse from the document |
void |
removeTimeSlot(TimeSlot timeSlot)
Removes a TimeSlot from the document |
void |
resetSchedule(Schedule localSchedule,
java.lang.String name)
|
void |
setBooks(java.util.ArrayList books)
|
void |
setChanged(boolean b)
|
void |
setClassrooms(java.util.ArrayList classrooms)
|
void |
setCourses(java.util.ArrayList courses)
|
void |
setDirectory(java.lang.String directory)
Sets the directory for the document |
void |
setProfessors(java.util.ArrayList professors)
|
void |
setSchedCourses(java.util.ArrayList schedCourses)
|
void |
setScheduleName(java.lang.String scheduleName)
|
void |
setTimeSlots(java.util.ArrayList timeSlots)
|
void |
sort(int key)
|
void |
update(java.util.Observable self,
java.lang.Object obj)
Any time the schedule changes, we will set a changed flag. |
java.lang.String |
updated()
|
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_FILE_NAME
Method Detail |
---|
public void update(java.util.Observable self, java.lang.Object obj)
update
in interface java.util.Observer
public void setChanged(boolean b)
public boolean getChanged()
public java.lang.String updated()
public void resetSchedule(Schedule localSchedule, java.lang.String name)
public static Schedule getSchedule()
public java.lang.String getScheduleName()
public void setScheduleName(java.lang.String scheduleName)
public java.lang.String getDirectory()
public void setDirectory(java.lang.String directory)
String
- directory the directorypublic java.util.ArrayList getProfessors()
Vector
specifying the instructorspublic void setProfessors(java.util.ArrayList professors)
public java.util.ArrayList getClassrooms()
Vector
specifying the class rooms.public void setClassrooms(java.util.ArrayList classrooms)
public java.util.ArrayList getCourses()
public void setCourses(java.util.ArrayList courses)
public java.util.ArrayList getTimeSlots()
public void setTimeSlots(java.util.ArrayList timeSlots)
public java.util.ArrayList getBooks()
public void setBooks(java.util.ArrayList books)
public java.util.ArrayList getSchedCourses()
public void setSchedCourses(java.util.ArrayList schedCourses)
public java.util.ArrayList getConflicts()
public Summary getSummary()
public void addProfessor(Professor prof)
Professor
- to be addedpublic void removeProfessor(Professor prof)
Professor
- to be removedpublic void addClassroom(Classroom classroom)
Classroom
- to be addedpublic void removeClassroom(Classroom classroom)
Classroom
- to be removedpublic void addTimeSlot(TimeSlot timeSlot)
TimeSlot
- to be addedpublic void removeTimeSlot(TimeSlot timeSlot)
TimeSlot
- to be removedpublic void addCourse(Course course)
Course
- to be addedpublic void removeCourse(Course course)
Course
- to be removedpublic void addBook(Textbook book)
public void removeBook(Textbook book)
public void addSchedCourse(SchedCourse schedCourse)
SchedCourse
- to be addedpublic void removeSchedCourse(SchedCourse schedCourse)
SchedCourse
- to be removedpublic void sort(int key)
public void changed()
public void findConflicts()
public void exportCsv(java.io.File outCsv) throws java.io.IOException
java.io.IOException
public int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
print
in interface java.awt.print.Printable
public int getNumberOfPages()
getNumberOfPages
in interface java.awt.print.Pageable
public java.awt.print.Printable getPrintable(int pageIndex)
getPrintable
in interface java.awt.print.Pageable
public java.awt.print.PageFormat getPageFormat(int pageIndex)
getPageFormat
in interface java.awt.print.Pageable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |