support.Flight
Class Parser
java.lang.Object
|
+--support.Flight.Parser
- public class Parser
- extends java.lang.Object
The methods in this class take the data stored in the flight databases
and parse it, creating containers of AirportSpecs and FlightSpecs.
The contents of the containers can be accessed as many times as
desired by calling airports() or flights().
|
Constructor Summary |
Parser(java.lang.String airport_filename,
java.lang.String flights_filename)
Parses the data files into containers, so the Parser object is ready
to have airports() or flights() called on it. |
|
Method Summary |
java.util.Enumeration |
airports()
Get results of parsing the airport database |
java.util.Enumeration |
flights()
Get results of parsing the flight database |
static void |
main(java.lang.String[] args)
A quick and dirty test to see that the above works. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Parser
public Parser(java.lang.String airport_filename,
java.lang.String flights_filename)
- Parses the data files into containers, so the Parser object is ready
to have airports() or flights() called on it.
- Parameters:
airport_filename, - i.e. "/course/cs016/asgn/support/Flight/data/graph.dat"flights_filename, - i.e. "/course/cs016/asgn/support/Flight/data/flight.dat"
airports
public java.util.Enumeration airports()
- Get results of parsing the airport database
- Returns:
- Enumeration of AirportSpecs, built from the database
flights
public java.util.Enumeration flights()
- Get results of parsing the flight database
- Returns:
- Enumeration of FlightSpecs, built from the database
main
public static void main(java.lang.String[] args)
- A quick and dirty test to see that the above works.
Usage:
java support.Flight.Parser <airports> <flights>
Where "airports" is the file with the list of airports, and
"flights" is the file with the list of flights.
- See Also: