|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RiderControls
A set of controls that can be used by a rider controller. Each rider uses a distinct RiderControls object.
Method Summary | |
---|---|
boolean |
enterElevator(int elevator)
Enter an elevator. |
boolean |
exitElevator(int floor)
Exit the elevator. |
void |
finish()
Call when the rider is finished. |
int |
getDirectionDisplay(int elevator)
Return the indicated direction of the specified elevator, set by ElevatorControls.setDirectionDisplay(). |
int |
getFloor()
Return the current location of the rider. |
int[] |
getFloors()
Return an array specifying the sequence of floors at which this rider has successfully exited an elevator. |
RiderEvent |
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 |
pressDirectionButton(boolean up)
Press a direction button. |
boolean |
pressDownButton()
Press the down button. |
boolean |
pressFloorButton(int floor)
Press a floor button. |
boolean |
pressUpButton()
Press the up button. |
void |
setInterruptHandler(Runnable handler)
Set the rider's interrupt handler. |
Method Detail |
---|
int getNumFloors()
int getNumElevators()
void setInterruptHandler(Runnable handler)
handler
- the rider's interrupt handler.int getFloor()
int[] getFloors()
int getDirectionDisplay(int elevator)
elevator
- the elevator to check the direction of.
ElevatorControls.setDirectionDisplay(int, int)
boolean pressDirectionButton(boolean up)
up
- true to press the up button, false to
press the down button.
boolean pressUpButton()
boolean pressDownButton()
boolean enterElevator(int elevator)
elevator
- the elevator to enter.
boolean pressFloorButton(int floor)
floor
- the button to press.
boolean exitElevator(int floor)
floor
- the floor to exit on.
void finish()
RiderEvent getNextEvent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |