|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectRoute
public class Route
A Route keeps track of information about a specific connection from one Airport to another. A route has a departure and arrival Airport, as well as a distance in miles.
Note that flights can be added to a Route, and an Iterator provides access to the flights in order of departure time (earlier flights first).
| Field Summary | |
|---|---|
protected Airport |
arrives
arrival airport |
protected Airport |
departs
departure airport |
protected int |
distance
distance in miles between airports |
protected OrderedList<Flight> |
flights
list of flights, ordered by departure time |
| Constructor Summary | |
|---|---|
Route(Airport departs,
Airport arrives,
int distance)
|
|
| Method Summary | |
|---|---|
void |
addFlight(Flight f)
|
Airport |
arrives()
|
Airport |
departs()
|
int |
distance()
|
Iterator<Flight> |
flights()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Airport departs
protected Airport arrives
protected OrderedList<Flight> flights
protected int distance
| Constructor Detail |
|---|
public Route(Airport departs,
Airport arrives,
int distance)
| Method Detail |
|---|
public Airport departs()
public Airport arrives()
public int distance()
public void addFlight(Flight f)
public Iterator<Flight> flights()
public String toString()
toString in class Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||