|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RiderInterface
A single rider. Each rider accesses the elevator bank through an instance of RiderControls.
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. |
Method Summary | |
---|---|
void |
initialize(RiderControls controls,
int[] stops)
Initialize this rider. |
void |
run()
Cause the rider to use the provided controls to make the stops specified in the constructor. |
Field Detail |
---|
static final int dirDown
static final int dirNeither
static final int dirUp
Method Detail |
---|
void initialize(RiderControls controls, int[] stops)
controls
- the rider's interface to the elevator bank. The
rider must not attempt to access the elevator
bank in any other way.stops
- an array of stops the rider should make; see
below.void run()
For example, suppose the rider uses controls to determine that it is initially on floor 1, and suppose the stops array contains two elements: { 0, 2 }. Then the rider should get on an elevator, get off on floor 0, get on an elevator, and get off on floor 2, pushing buttons as necessary.
This method should not return, but instead should call controls.finish() when the rider is finished.
run
in interface Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |