Modifier and Type | Field and Description |
---|---|
private Map<String,Flight> |
FlightManager.flights
Map that holds Flights where the key is the flight number, and the value is
the flight itself
|
private List<Flight> |
Trip.legs
The list of flights (legs) that comprise this trip
|
Modifier and Type | Method and Description |
---|---|
private static Flight |
FlightTest.createBadTestFlightOne() |
private static Flight |
FlightTest.createBadTestFlightTwo() |
private static Flight |
FlightTest.createTestFlight() |
private static Flight |
FlightManagerTest.createTestFlight(String num,
Airport origin,
Airport dest,
double cost)
Creates a Flight with current date (LocalDate.now()).
|
Flight |
FlightManager.getFlight(String number)
Returns the Flight with the specified flight number
|
Flight |
FlightManager.removeFlight(Flight flight)
Removes and returns the Flight,
flight |
Flight |
FlightManager.removeFlight(String number)
Removes and returns the Flight with flight number,
number |
Modifier and Type | Method and Description |
---|---|
List<Flight> |
FlightManager.getFlights()
Returns a list of all flights.
|
List<Flight> |
FlightManager.getFlightsByOrigin(String originCode)
Returns a list of Flights that originate at
originCode (on any date). |
List<Flight> |
FlightManager.getFlightsByOrigin(String originCode,
LocalDate date)
Returns a list of Flights that originate at
originCode on date ,
where date is a String. |
List<Flight> |
FlightManager.getFlightsByOrigin(String originCode,
String date)
Returns a list of Flights that originate at
originCode on date ,
where date is a LocalDate |
List<Flight> |
FlightManager.getFlightsByOriginAndDestination(String originCode,
String destinationCode,
LocalDate date)
Returns a list of Flights between
originCode and destinationCode
that occur on date , where date is a LocalDate |
List<Flight> |
FlightManager.getFlightsByOriginAndDestination(String originCode,
String destinationCode,
String date)
Returns a list of Flights between
originCode and destinationCode
that occur on date , where date is a String |
List<Flight> |
Trip.getLegs()
Returns the list of legs.
|
Modifier and Type | Method and Description |
---|---|
boolean |
FlightManager.addFlight(Flight flight)
Adds flight to the map of flights, provided the key doesn't exist, and returns true;
otherwise, returns false.
|
void |
Trip.addLeg(Flight leg)
Adds a leg to this trip.
|
private boolean |
Trip.doesDateMatch(Flight previousLeg,
Flight nextLeg)
Optional, this is a helper method I wrote.
|
private boolean |
Trip.doesDestinationOriginMatch(Flight previousLeg,
Flight nextLeg)
Optional, this is a helper method I wrote.
|
private boolean |
FlightManager.doesMatchDate(LocalDate date,
Flight flight)
Optional, this is a helper method I wrote.
|
private boolean |
FlightManager.doesMatchDestination(String destinationCode,
Flight flight)
Optional, this is a helper method I wrote.
|
private boolean |
FlightManager.doesMatchOrigin(String originCode,
Flight flight)
Optional, this is a helper method I wrote.
|
Flight |
FlightManager.removeFlight(Flight flight)
Removes and returns the Flight,
flight |
Modifier and Type | Method and Description |
---|---|
private static void |
FlightManagerTest.print(List<Flight> flights) |
Constructor and Description |
---|
Trip(List<Flight> legs)
Initializes a trip with a list of legs.
|