Package at.jku.ssw.fp.airline
Class Airline
- java.lang.Object
-
- at.jku.ssw.fp.airline.Airline
-
-
Field Summary
Fields Modifier and Type Field Description static Airline[]
AIRLINES
Array with some airline objects.String
code
The code of the airlineprivate static int
DELAY_CONST
Constant for the delay of retrieving a flight from an airline.private static int
DELAY_VARIATION
Constant for the variation of the delay of retrieving a flight from an airline.String
name
The name of the airline(package private) static Random
RAND
A random number generator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Flight
findFlight(String from, String to, LocalDate date)
Returns a flight provided by the airline.CompletableFuture<Flight>
findFlightAsync(String from, String to, LocalDate date)
Returns a completable future for a flight provided by the airline.List<Flight>
findFlights(String from, String to, LocalDate date)
Returns a list of flights offered by the airline.Offer
getOffer(Flight flight)
Returns a offer for a flight.String
toString()
Returns a string representation of the airline.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface at.jku.ssw.fp.airline.Retailer
getOfferAsync
-
-
-
-
Field Detail
-
AIRLINES
public static final Airline[] AIRLINES
Array with some airline objects.
-
DELAY_CONST
private static final int DELAY_CONST
Constant for the delay of retrieving a flight from an airline.- See Also:
- Constant Field Values
-
DELAY_VARIATION
private static final int DELAY_VARIATION
Constant for the variation of the delay of retrieving a flight from an airline.- See Also:
- Constant Field Values
-
RAND
static final Random RAND
A random number generator
-
code
public final String code
The code of the airline
-
name
public final String name
The name of the airline
-
-
Method Detail
-
findFlight
public Flight findFlight(String from, String to, LocalDate date)
Returns a flight provided by the airline.- Parameters:
from
- the originto
- the destinationdate
- the date- Returns:
- the flight object provided by the airline
-
findFlightAsync
public CompletableFuture<Flight> findFlightAsync(String from, String to, LocalDate date)
Returns a completable future for a flight provided by the airline.- Parameters:
from
- the originto
- the destinationdate
- the date- Returns:
- a completable future for flight object provided by the airline
-
findFlights
public List<Flight> findFlights(String from, String to, LocalDate date)
Returns a list of flights offered by the airline.- Parameters:
from
- the originto
- the destinationdate
- the date- Returns:
- the list of flights offered by the airline
-
-