|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cscie160.hw1.Elevator
Field Summary | |
static int |
CAPACITY
|
static int |
NUM_FLOORS
|
Constructor Summary | |
Elevator()
|
Method Summary | |
void |
boardPassenger(int destinationFloor)
Board a passenger destined for a floor. |
int |
findDirection()
Return the direction of closest destination floor, with preference for moving down. |
void |
go()
Drive elevator to next destination. |
static void |
main(java.lang.String[] argv)
Create an elevator and board two passengers into it. |
void |
move()
Move elevator one floor in the travelDirection. |
void |
stop()
Stop the elevator and unload passengers destined for this floor. |
java.lang.String |
toString()
Override the toString() method of java.lang.Object for printing Elevator values. |
void |
unloadPassenger()
Unload a passenger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int CAPACITY
public static final int NUM_FLOORS
Constructor Detail |
public Elevator()
Method Detail |
public void move()
public void boardPassenger(int destinationFloor)
destinationFloor
- The floor that passenger wants to go to.public void unloadPassenger()
public void stop()
public int findDirection()
public void go()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |