public abstract class ScheduleDB
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.Collection<Schedule> |
schedules |
Constructor and Description |
---|
ScheduleDB() |
Modifier and Type | Method and Description |
---|---|
abstract void |
add(Schedule sched)
Adds a Schedule to the database.
|
abstract void |
change(Schedule old_sched,
Schedule new_sched)
Change the given old Schedule to the given new Schedule.
|
abstract Schedule |
findByName(java.lang.String name)
Find a schedule by a unique name.
|
abstract void |
remove(Schedule sched)
Removes a Schedule from the database.
|
abstract java.util.List<Schedule> |
viewSchedules()
Returns sorted list of Schedules.
|
public java.util.Collection<Schedule> schedules
public abstract void add(Schedule sched)
sched
- - Schedule to be added
pre:
//
// There is no schedule in the input db with the same name
// as the schedule to be added.
//
!exists (Schedule other;
schedules.contains(other);
sched.name.equals(other.name));
post:
//
// A schedule is in the output db if and only if it is the schedule
// to be added or it is in the input db.
//
forall (Schedule other;
schedules'.contains(sched) iff
other.equals(sched) || schedules.contains(other));public abstract void remove(Schedule sched)
sched
- - Schedule to be removed
pre:
//
// The given Schedule is in the ScheduleDB.
//
schedules.contains(sched);
post:
//
// A schedule is in the output db if and only if it is not the existing
// schedule to be removed and it is in the input db.
//
forall (Schedule other;
schedules'.contains(other) iff
!other.equals(sched) && schedules.contains(other));public abstract Schedule findByName(java.lang.String name)
public abstract java.util.List<Schedule> viewSchedules()
public abstract void change(Schedule old_sched, Schedule new_sched)