|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnachos.machine.ElevatorBank
public final class ElevatorBank
A bank of elevators.
Field Summary | |
---|---|
static int |
dirDown
Indicates an elevator intends to move down. |
static int |
dirNeither
Indicates an elevator intends not to move. |
static int |
dirUp
Indicates an elevator intends to move up. |
Constructor Summary | |
---|---|
ElevatorBank(Privilege privilege)
Allocate a new elevator bank. |
Method Summary | |
---|---|
RiderControls |
addRider(RiderInterface rider,
int floor,
int[] stops)
Add a rider to the simulation. |
void |
enableGui()
Create a GUI for this elevator bank. |
void |
init(int numElevators,
int numFloors,
ElevatorControllerInterface controller)
Initialize this elevator bank with the specified number of elevators and the specified number of floors. |
void |
run()
Run a simulation. |
static void |
selfTest()
Tests whether this module is working. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int dirDown
public static final int dirNeither
public static final int dirUp
Constructor Detail |
---|
public ElevatorBank(Privilege privilege)
privilege
- encapsulates privileged access to the Nachos
machine.Method Detail |
---|
public void init(int numElevators, int numFloors, ElevatorControllerInterface controller)
numElevators
- the number of elevators in the bank.numFloors
- the number of floors in the bank.controller
- the elevator controller.public RiderControls addRider(RiderInterface rider, int floor, int[] stops)
rider
- the rider to add.floor
- the floor the rider will start on.stops
- the array to pass to the rider's initialize()
method.
public void enableGui()
public void run()
run
in interface Runnable
public static void selfTest()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |