nachos.machine
Class RiderEvent

java.lang.Object
  extended by nachos.machine.RiderEvent

public final class RiderEvent
extends Object

An event that affects rider software. If a rider is outside the elevators, it will only receive events on the same floor as the rider. If a rider is inside an elevator, it will only receive events pertaining to that elevator.


Field Summary
 int direction
          The direction display of the elevator (neither if not applicable).
 int elevator
          The elevator pertaining to the event, or -1 if not applicable.
 int event
          The event identifier.
static int eventDirectionChanged
          An elevator's doors were open and its direction display changed.
static int eventDoorsClosed
          An elevator's doors have closed.
static int eventDoorsOpened
          An elevator's doors have opened.
 int floor
          The floor pertaining to the event, or -1 if not applicable.
 
Constructor Summary
RiderEvent(int event, int floor, int elevator, int direction)
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

event

public final int event
The event identifier. Refer to the event* constants.


floor

public final int floor
The floor pertaining to the event, or -1 if not applicable.


elevator

public final int elevator
The elevator pertaining to the event, or -1 if not applicable.


direction

public final int direction
The direction display of the elevator (neither if not applicable).


eventDoorsOpened

public static final int eventDoorsOpened
An elevator's doors have opened.

See Also:
Constant Field Values

eventDirectionChanged

public static final int eventDirectionChanged
An elevator's doors were open and its direction display changed.

See Also:
Constant Field Values

eventDoorsClosed

public static final int eventDoorsClosed
An elevator's doors have closed.

See Also:
Constant Field Values
Constructor Detail

RiderEvent

public RiderEvent(int event,
                  int floor,
                  int elevator,
                  int direction)