Class Session

java.lang.Object
  extended by Session

public class Session
extends Object

A session is defined by the test subjects (students), the room, the start time, and the duration. Note that duration includes both the active experiment time and the inter-session turn-around time.

Version:
14 March 2006

Field Summary
static int DEFAULT_DURATION
          The default duration of a session, in minutes.
 
Constructor Summary
Session()
          Construct Session object with default duration.
Session(Time theDuration)
          Construct Session object with specified duration.
Session(Time theDuration, Room theRoom, Time theStartTime)
          Construct Session object with specified duration, room and start time.
 
Method Summary
 void addSubject(Student newSubject)
          Add a test subject.
 Time getDuration()
          Return the duration of this session.
 int getNumberOfSubjects()
          Return the number of test subjects currently assigned to this session.
 Room getRoom()
          Return the room of this session.
 Time getStartTime()
          Return the start time of this session.
 Student getSubject(int which)
          Return a specific test subject.
 ArrayList<Student> getSubjects()
          Return the test subjects in this session.
 void setDuration(Time newDuration)
          Change the duration of this session.
 void setRoom(Room newRoom)
          Change the room of this session.
 void setStartTime(Time newStartTime)
          Change the start time of this session.
 void setSubjects(ArrayList<Student> newSubjects)
          Change the test subjects in this session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DURATION

public static final int DEFAULT_DURATION
The default duration of a session, in minutes.

See Also:
Constant Field Values
Constructor Detail

Session

public Session()
Construct Session object with default duration. Room and start time are set to null. The list of test subjects is set to the empty list.


Session

public Session(Time theDuration)
Construct Session object with specified duration. Room and start time are set to null. The list of test subjects is set to the empty list.

Parameters:
theDuration - the duration

Session

public Session(Time theDuration,
               Room theRoom,
               Time theStartTime)
Construct Session object with specified duration, room and start time. The list of test subjects is set to the empty list.

Parameters:
theDuration - the duration
theRoom - the room
theStartTime - the start time
Method Detail

getNumberOfSubjects

public int getNumberOfSubjects()
Return the number of test subjects currently assigned to this session.

Returns:
the number of subjects

getDuration

public Time getDuration()
Return the duration of this session.

Returns:
the duration

getStartTime

public Time getStartTime()
Return the start time of this session.

Returns:
the start time

getRoom

public Room getRoom()
Return the room of this session.

Returns:
the room

getSubjects

public ArrayList<Student> getSubjects()
Return the test subjects in this session.

Returns:
the test subjects

getSubject

public Student getSubject(int which)
Return a specific test subject.

Parameters:
which - the index of the test subject
Returns:
the test subject at index "which"

setDuration

public void setDuration(Time newDuration)
Change the duration of this session.

Parameters:
newDuration - the new duration (in minutes)

setStartTime

public void setStartTime(Time newStartTime)
Change the start time of this session.

Parameters:
newStartTime - the new start time

setRoom

public void setRoom(Room newRoom)
Change the room of this session.

Parameters:
newRoom - the new room

setSubjects

public void setSubjects(ArrayList<Student> newSubjects)
Change the test subjects in this session.

Parameters:
newSubjects - the new test subjects

addSubject

public void addSubject(Student newSubject)
Add a test subject.

Parameters:
newSubject - the new test subject