scheduler.generate
Class ScheduleItem

java.lang.Object
  extended by scheduler.generate.ScheduleItem

public class ScheduleItem
extends java.lang.Object

Represents a single, scheduled course. Contains information regarding: which course it represents; which instructor teaches the course, and its section; where the course will be held; what day(s) the course will be held; what time the course will start/end.

Author:
Eric Liebowitz

Field Summary
 Course c
          The course for this scheduled item
 Week days
          The days in the week this item is scheduled
 Time end
          The time at which this scheduled item ends
 Instructor i
          The instructor for this scheduled item
 Location l
          The location for this scheduled item
 int section
          Course section (will someday be removed)
 Time start
          The time at which this scheduled item starts
 
Constructor Summary
ScheduleItem(Instructor i, Course c, Location l, int section, Week days, Time s, Time e)
          Creates a scheduled course, complete with instructor, location section, days taught, and start/end time.
 
Method Summary
 boolean equals(ScheduleItem s)
          Compares to ScheduleItem's.
 java.lang.String toString()
          Displays all this object's fields in a visually easy-to-read form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

i

public Instructor i
The instructor for this scheduled item


c

public Course c
The course for this scheduled item


l

public Location l
The location for this scheduled item


section

public int section
Course section (will someday be removed)


days

public Week days
The days in the week this item is scheduled


start

public Time start
The time at which this scheduled item starts


end

public Time end
The time at which this scheduled item ends

Constructor Detail

ScheduleItem

public ScheduleItem(Instructor i,
                    Course c,
                    Location l,
                    int section,
                    Week days,
                    Time s,
                    Time e)
Creates a scheduled course, complete with instructor, location section, days taught, and start/end time.

Parameters:
i - Instructor teaching the course
c - Course being taught
l - Location course will be taught
days - Days of the week this course will be taught
start - Time the course starts
end - Time the course ends
 // **Pre and Post Conditions** //

 Pre:

    //None of the parameters may be 0 or null
    i != null

       &&

    c != null

       &&

    l != null

       &&

    section > 0

       &&

    days != null

       &&

    start != null

       &&

    end != null

       &&

    //Start time cannot be after end time
    start < end

       &&

    //Must be assigned to at least one days
    days.numOf > 0

   NOTE: All of these preconditions are assumed "by-contract". So, 
                there is no explicit check for them.
 
 Post:
    
    //All fields in object must equal those passed in
    this.i.equals(i)           &&
    this.c.equals(c)           &&
    this.l.equals(l)           &&
    this.section == section    &&
    this.days.equals(days)     &&
    this.start.equals(start)   &&
    this.end.equals(end)
 
Method Detail

equals

public boolean equals(ScheduleItem s)
Compares to ScheduleItem's.

Parameters:
s - The object to compare with "this"
Returns:
true if all the fields in "s" are equal to those in "this". False otherwise.

toString

public java.lang.String toString()
Displays all this object's fields in a visually easy-to-read form.

Overrides:
toString in class java.lang.Object