|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
public int getNumFloors()
public int getNumElevators()
public void setInterruptHandler(Runnable handler)
handler
- the rider's interrupt handler.public int getFloor()
public int[] getFloors()
public int getDirectionDisplay(int elevator)
elevator
- the elevator to check the direction of.
ElevatorControls.setDirectionDisplay(int, int)
public boolean pressDirectionButton(boolean up)
up
- true to press the up button, false to
press the down button.
public boolean pressUpButton()
public boolean pressDownButton()
public boolean enterElevator(int elevator)
elevator
- the elevator to enter.
public boolean pressFloorButton(int floor)
floor
- the button to press.
public boolean exitElevator(int floor)
floor
- the floor to exit on.
public void finish()
public RiderEvent getNextEvent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |