Modifier and Type | Field and Description |
---|---|
private Airport |
Flight.destination
The destination Airport
|
private Airport |
Flight.origin
The origin Airport.
|
Modifier and Type | Field and Description |
---|---|
private Map<String,Airport> |
AirportManager.airports
A map of Airports where the airport code is the key and the value is an Airport.
|
Modifier and Type | Method and Description |
---|---|
private static Airport |
AirportTest.createTestAirportOne() |
private static Airport |
AirportTest.createTestAirportThree() |
private static Airport |
AirportTest.createTestAirportTwo() |
Airport |
AirportManager.getAirport(String code)
Returns the airport with specified code if it exists
|
private Airport |
AirportManager.getAirportClosestTo(List<Airport> airports,
String code)
This is a helper method I wrote.
|
Airport |
AirportManager.getAirportClosestTo(String code)
Returns the Airport closest in distance (miles) to the airport specified by the input code
|
Airport |
AirportManager.getAirportClosestTo2(String code)
Returns the Airport closest in distance (miles) to the airport specified by the input code,
different implementation of getAirportClosestTo
|
Airport |
Flight.getDestination() |
Airport |
Trip.getDestination()
Returns the airport where trip ends.
|
Airport |
Flight.getOrigin() |
Airport |
Trip.getOrigin()
Returns the airport where trip begins.
|
Airport |
AirportManager.removeAirport(String code)
Removes an airport from the AirportManager
|
Modifier and Type | Method and Description |
---|---|
static Map<String,Airport> |
AirportLoader.getAirportMap(File airportFile)
Returns a map of Airport objects constructed from reading the file
specified by the argument.
|
List<Airport> |
AirportManager.getAirports()
Returns a list of all airports
|
List<Airport> |
AirportManager.getAirportsByCity(String city)
Returns a list of the Airports whose “City” begins with "city", i.e.
|
List<Airport> |
AirportManager.getAirportsByCityState(String city,
String state)
Returns a list of the Airports whose “City” is city and “State” is state.
|
List<Airport> |
AirportManager.getAirportsClosestTo(String code,
int num)
Returns a list of the
num Airports that are closest in distance (miles) to the Airport with |
List<Airport> |
AirportManager.getAirportsSortedBy(String sortType)
Returns a list of Airports that are sorted according to sortType.
|
List<Airport> |
AirportManager.getAirportsWithin(double withinDist,
double lat,
double lon)
Returns a list of Airports within a distance, withinDist, of the
input latitude & longitude.
|
List<Airport> |
AirportManager.getAirportsWithin(String code,
double withinDist)
Returns a list of Airports within a distance, withinDist, of the
airport specified by its code.
|
List<Airport> |
AirportManager.getAirportsWithin(String code1,
String code2,
double withinDist)
Returns a list of Airports which are within withinDist of both the
Airports that correspond to code1 and code2.
|
List<Airport> |
AirportManager.getNWSNamedAirports()
Returns a list of the Airports whose code follows the National Weather Service (NWS)
naming system.
|
Modifier and Type | Method and Description |
---|---|
boolean |
AirportManager.addAirport(Airport airport)
Adds an airport to the AirportManager
|
int |
AirportStateComparator.compare(Airport a1,
Airport a2) |
int |
AirportCityComparator.compare(Airport a1,
Airport a2) |
private static Flight |
FlightManagerTest.createTestFlight(String num,
Airport origin,
Airport dest,
double cost)
Creates a Flight with current date (LocalDate.now()).
|
double |
AirportManager.getDistanceBetween(Airport airport1,
Airport airport2)
Returns the distance between two airports.
|
(package private) String |
Flight.location(Airport a)
Optional, this is a helper method I wrote.
|
private String |
Trip.location(Airport a)
Optional, this is a helper method I wrote.
|
Modifier and Type | Method and Description |
---|---|
private Airport |
AirportManager.getAirportClosestTo(List<Airport> airports,
String code)
This is a helper method I wrote.
|
private static void |
AirportManagerTest.print(List<Airport> airports) |
private static void |
AirportManagerTest.print(Map<String,Airport> airports) |
private static void |
TripTest.print(Map<String,Airport> airports) |
private static void |
AirportLoaderTest.print(Map<String,Airport> airports) |
Constructor and Description |
---|
Flight(String number,
LocalDate date,
Airport origin,
Airport destination,
double cost)
Creates a Flight object if the flight number is valid
Flight.number , otherwise throws
an InvalidArgumentException. |
Flight(String number,
String date,
Airport origin,
Airport destination,
double cost)
Creates a Flight object if the flight number is valid
Flight.number , otherwise throws
an InvalidArgumentException. |
Constructor and Description |
---|
AirportManager(Map<String,Airport> airports)
Creates the AirportManager with a map of airports.
|