|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ElevatorControls
A set of controls that can be used by an elevator controller.
Method Summary | |
---|---|
void |
closeDoors(int elevator)
Close an elevator's doors. |
void |
finish()
Call when the elevator controller is finished. |
int |
getFloor(int elevator)
Return the current location of the elevator. |
ElevatorEvent |
getNextEvent()
Return the next event in the event queue. |
int |
getNumElevators()
Return the number of elevators in the elevator bank. |
int |
getNumFloors()
Return the number of floors in the elevator bank. |
boolean |
moveTo(int floor,
int elevator)
Move an elevator to another floor. |
void |
openDoors(int elevator)
Open an elevator's doors. |
void |
setDirectionDisplay(int elevator,
int direction)
Set which direction the elevator bank will show for this elevator's display. |
void |
setInterruptHandler(Runnable handler)
Set the elevator interrupt handler. |
Method Detail |
---|
int getNumFloors()
int getNumElevators()
void setInterruptHandler(Runnable handler)
handler
- the elevator interrupt handler.void openDoors(int elevator)
elevator
- which elevator's doors to open.void closeDoors(int elevator)
elevator
- which elevator's doors to close.boolean moveTo(int floor, int elevator)
floor
- the floor to move to.elevator
- the elevator to move.
int getFloor(int elevator)
elevator
- the elevator to locate.
void setDirectionDisplay(int elevator, int direction)
elevator
- the elevator whose direction display to set.direction
- the direction to show (up, down, or neither).void finish()
ElevatorEvent getNextEvent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |