|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cscie160.hw3.Passenger
CSCIE160
Assignment 2: Elevator part 2
Date Due: March 14, 2001
Passenger class: This class complements the elevator class and floor class for the elevator project. This is done according to the specification on homework 3.
By David Cheung
Constructor Summary | |
Passenger(int numDestFloor)
Constructors: |
|
Passenger(int numCurrentfloor,
int numDestFloor)
|
Method Summary | |
void |
arrive()
arrive() |
int |
getCurrentFloor()
getCurrentFloor; |
int |
getDestFloor()
getDestFloor; |
static void |
main(java.lang.String[] argv)
Main: Test purposes only. |
void |
setCurrFloor(int numFloor)
setCurrentFloor; |
void |
setDestFloor(int numFloor)
setDestFloor; |
java.lang.String |
toString()
toString() |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Passenger(int numDestFloor)
Passenger(int DestFloor), or Floor(int CurrentFloor, int DestFloor)
Assumes the current floor is 1 if only 1 integer value is passed.
DestFloor
- the destination floor of the passengerCurrentFloor
- the currentfloor of the passenger.public Passenger(int numCurrentfloor, int numDestFloor)
Method Detail |
public void arrive()
public int getCurrentFloor()
This returns the interger value of which the passenger is currently in.
public int getDestFloor()
This function returns the integer value for the destination for the passenger.
public void setCurrFloor(int numFloor)
This sets the currentfloor. The value takes in an integer for the floor.
numFloor
- sets the current floor numberpublic void setDestFloor(int numFloor)
This sets the destination floor.
numFloor
- sets the destination floorpublic java.lang.String toString()
For Test purposes: Shows the passenger Current Floor and Destination Floor.
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |