|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object FlytrapAirlines
public class FlytrapAirlines
The main class for FlytrapAirlines.
Field Summary | |
---|---|
protected Hashtable<String,Airport> |
airports
A table of Airports. |
protected Graph<Airport,Route> |
schedule
The schedule for FTA. |
Constructor Summary | |
---|---|
FlytrapAirlines(String prefix)
|
Method Summary | |
---|---|
protected Map<Airport,ComparableAssociation<Integer,Edge<Airport,Route>>> |
dijkstra(Graph<Airport,Route> g,
Airport start)
An implementation of dijkstra's algorithm to compute route distances. |
protected Map<Airport,ComparableAssociation<Integer,Flight>> |
dijkstraEarliestArrival(Graph<Airport,Route> g,
Airport start,
int time)
An implementation of Dijkstra's algorithm to compute earliest-arriving itineraries. |
protected Airport |
getAirport(String s)
Helper method to convert an airport code to a Airport object. |
protected void |
loadFiles(String prefix)
Reads in the airports.txt, dists.txt. |
static void |
main(String[] s)
|
protected void |
printAirports()
Handles the "airports" command by printing an alphabetic list of airports serviced by FTA. |
protected void |
printDistance(Airport departAirport,
Airport arriveAirport)
Handles the "distance" command. |
protected void |
printFlights(Airport departAirport,
Airport arriveAirport)
Handles the "flights" command. |
protected void |
printHelp()
Handles the "help" command by printing a help message. |
protected void |
printItinerary(Map<Airport,ComparableAssociation<Integer,Flight>> earliestArrivals,
Airport destination)
|
protected void |
printShortestPath(Map<Airport,ComparableAssociation<Integer,Edge<Airport,Route>>> distances,
Airport destination)
|
protected void |
printTrip(Airport departAirport,
Airport arriveAirport,
int earliestDepartTime)
Handles the "trip" command. |
void |
processCommands()
Reads in commands and processes them until "quit" is seen. |
protected void |
readAirports(String fileName)
Helper method to read in airport data file. |
protected void |
readDistances(String fileName)
Helper method to read in the distances between airports serviced by flights. |
protected void |
readFlights(String fileName)
Helper method to read in flight info. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Graph<Airport,Route> schedule
protected Hashtable<String,Airport> airports
Constructor Detail |
---|
public FlytrapAirlines(String prefix)
Method Detail |
---|
public void processCommands()
protected Airport getAirport(String s)
protected void printHelp()
protected void printAirports()
protected void printFlights(Airport departAirport, Airport arriveAirport)
protected void printDistance(Airport departAirport, Airport arriveAirport)
protected Map<Airport,ComparableAssociation<Integer,Edge<Airport,Route>>> dijkstra(Graph<Airport,Route> g, Airport start)
protected void printShortestPath(Map<Airport,ComparableAssociation<Integer,Edge<Airport,Route>>> distances, Airport destination)
protected void printTrip(Airport departAirport, Airport arriveAirport, int earliestDepartTime)
protected Map<Airport,ComparableAssociation<Integer,Flight>> dijkstraEarliestArrival(Graph<Airport,Route> g, Airport start, int time)
protected void printItinerary(Map<Airport,ComparableAssociation<Integer,Flight>> earliestArrivals, Airport destination)
protected void loadFiles(String prefix)
You should not modify this code.
protected void readAirports(String fileName)
protected void readDistances(String fileName)
protected void readFlights(String fileName)
public static void main(String[] s)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |