Class ScheduleSearchCriteria
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.Flight
org.deltava.beans.schedule.ScheduleSearchCriteria
- All Implemented Interfaces:
Serializable, Comparable<Object>, FlightNumber, IDBean, RoutePair, Cacheable
A bean to store search criteria for the Flight Schedule.
- Since:
- 1.0
- Version:
- 12.0
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface RoutePair
RoutePair.RoutePairImplModifier and TypeInterfaceDescriptionstatic classHelper class when all you need is a naked RoutePair. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<ComboAlias> static final String[]static final List<ComboAlias> -
Constructor Summary
ConstructorsConstructorDescriptionScheduleSearchCriteria(String sortBy) Initializes the search criteria.ScheduleSearchCriteria(Airline a, int fNumber, int leg) Initializes the search criteria. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEquipmentType(String eqType) Adds an equipment type to search with.booleanReturns the database to search.Returns whether to search for flights with dispatch flight plans.final intReturns the distance between the Airports.final intfinal DurationDISABLED property.final StringReturns the Equipment type for this flightReturns the equipment types to search for.Returns whether to exclude historic flights from the search.intReturns the maximum number of schedule entries per route to return.intgetHourA()intgetHourD()Returns whether to include Flight Academy flights in the search.intfinal intA method to return the length of the flight in hours multiplied by 10.intReturns the maximum numnber of schedule entries to return.booleanReturns whether to only search routes including an airport not previously visited.booleanReturns whether to only search routes including an airport not previously visited.intReturns the Pilot ID, if filtering for unvisited airports.intReturns the SQL sorting clause.getTimeA()getTimeD()booleanReturns whether this is a search by leg or by route.voidsetCheckDispatchRoutes(boolean checkDispatch) Checks whether route pairs have Dispatch routes associated with them.voidUpdates the database to search.voidsetDispatchOnly(Inclusion dspOnly) Includes only flights between airports that have a Dispatch route in the database.voidsetDistance(int distance) Sets the distance of the flight.voidsetDistanceRange(int range) Sets the distance range of the flight.final voidsetEquipmentType(String eqType) Sets the equipment type for this flight.voidsetEquipmentTypes(Collection<String> eqTypes) Updates the equipment types to search with.voidsetExcludeHistoric(Inclusion exHistoric) Excludes historic flights form the search.voidsetFlightsPerRoute(int maxFlights) Sets the preferred number of flights per route to return.voidsetHourA(int hour) voidsetHourD(int hour) voidsetIncludeAcademy(Inclusion doInclude) Includes Flight Academy flights in the search.voidsetLastFlownInterval(int days) Sets the interval since the last time the route was flown.voidsetLength(int length) Sets the length of the flight.voidsetMaxResults(int results) Sets the maximum number of schedule entries to return.voidsetNotVisitedA(boolean nv) Includes only unvisited arrival airports.voidsetNotVisitedD(boolean nv) Includes only unvisited departure airports.voidsetPilotID(int id) The Pilot database ID, if filtering for unvisited airports.voidsetRouteLegs(int legs) Sets the number of route legs flown by the pilot.voidMethods inherited from class Flight
compareTo, equals, getAirline, getAirportA, getAirportD, getCallsign, getFlightCode, getFlightNumber, getLeg, getLegCode, getShortCode, hashCode, setAirline, setAirportA, setAirportD, setFlightNumber, setLeg, toStringModifier and TypeMethodDescriptionintbooleanReturns the Airline.Returns the arrival Airport.Returns the departure Airport.Returns the flight code as a callsign, using the Airline ICAO code.Returns a text representation of the Flight in the format "CODE### Leg #".intReturns the Flight Number.intgetLeg()Returns the Flight Leg.Returns an abbreviated version of the Flight code with a dash instead of text.Returns the Flight code without the leg.inthashCode()voidSet the Airline for this flight.voidSets the Arrival Airport object for this flight.voidSets the Departure Airport object for this flight.voidsetFlightNumber(int fNumber) Set the Flight Number for this flightvoidsetLeg(int leg) Sets the Flight leg for this flighttoString()Methods inherited from class DatabaseBean
cacheKey, getHexID, getID, setID, validateID, validateIDModifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.getHexID()Returns the hexadecimal database ID of this object.intgetID()Returns the database ID of this object.voidsetID(int id) Update the database row ID of this bean.static voidvalidateID(int oldID, int newID) Validates a database ID.static voidvalidateID(int oldID, int newID, boolean allowZero) Validates a database ID.Methods inherited from interface RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches, midPointModifier and TypeMethodDescriptiondefault StringReturns a key that describes the route pair.Returns the airports in this Route Pair.default FlightTypeReturns the flight type for customs/gate purposes.default booleanReturns whether this RoutePair includes a particular IATA or ICAO code.default booleanReturns whether both airports are populated.default booleanReturns whether this RoutePair matches a particular Route Pair.default GeoLocationmidPoint()Returns the midpoint between the two Airports on a Great Circle route.
-
Field Details
-
SORT_CODES
-
SORT_OPTIONS
-
HOURS
-
-
Constructor Details
-
ScheduleSearchCriteria
Initializes the search criteria.- Parameters:
a- the AirlinefNumber- the flight numberleg- the leg number
-
ScheduleSearchCriteria
Initializes the search criteria.- Parameters:
sortBy- the sorting SQL clause
-
-
Method Details
-
getDBName
-
getSortBy
-
getDistance
public final int getDistance()Description copied from interface:RoutePairReturns the distance between the Airports.- Specified by:
getDistancein interfaceRoutePair- Overrides:
getDistancein classFlight- Returns:
- the distance in miles, or -1 if not populated
-
getDistanceRange
public final int getDistanceRange() -
getPilotID
public int getPilotID()Returns the Pilot ID, if filtering for unvisited airports.- Returns:
- the Pilot's database ID
-
getNotVisitedD
public boolean getNotVisitedD()Returns whether to only search routes including an airport not previously visited.- Returns:
- TRUE if only including unvisited departure Airports, otherwise FALSE
-
getNotVisitedA
public boolean getNotVisitedA()Returns whether to only search routes including an airport not previously visited.- Returns:
- TRUE if only including unvisited arrival Airports, otherwise FALSE
-
getCheckDispatch
public boolean getCheckDispatch() -
getExcludeHistoric
Returns whether to exclude historic flights from the search.- Returns:
- an Inclusion
-
getDispatchOnly
Returns whether to search for flights with dispatch flight plans.- Returns:
- an Inclusion
-
getIncludeAcademy
Returns whether to include Flight Academy flights in the search.- Returns:
- an Inclusion
-
getFlightsPerRoute
public int getFlightsPerRoute()Returns the maximum number of schedule entries per route to return.- Returns:
- the maximum number of entries
-
getRouteLegs
public int getRouteLegs() -
getLastFlownInterval
public int getLastFlownInterval() -
getTimeD
-
getHourD
public int getHourD() -
getTimeA
-
getHourA
public int getHourA() -
getLength
-
getDuration
DISABLED property.- Specified by:
getDurationin classFlight- Returns:
- a Duration
- Throws:
UnsupportedOperationException
-
getMaxResults
public int getMaxResults()Returns the maximum numnber of schedule entries to return.- Returns:
- the maximum number of results
-
isRouteSearch
public boolean isRouteSearch()Returns whether this is a search by leg or by route. Route searches as used for limits on flight route legs or number of times flown.- Returns:
- TRUE if limited by legs flown or schedule entries per route pair, otherwise FALSE
-
setSortBy
-
setHourD
public void setHourD(int hour) -
setHourA
public void setHourA(int hour) -
getEquipmentTypes
Returns the equipment types to search for.- Returns:
- a Collection of equipment type names
-
setDBName
-
setLength
public void setLength(int length) Sets the length of the flight.- Parameters:
length- the length in hours multiplied by ten
-
setDistance
public void setDistance(int distance) Sets the distance of the flight.- Parameters:
distance- the distance in miles
-
setDistanceRange
public void setDistanceRange(int range) Sets the distance range of the flight.- Parameters:
range- the distance range in miles
-
setPilotID
public void setPilotID(int id) The Pilot database ID, if filtering for unvisited airports.- Parameters:
id- the Pilot ID
-
setMaxResults
public void setMaxResults(int results) Sets the maximum number of schedule entries to return.- Parameters:
results- the number of entries
-
setFlightsPerRoute
public void setFlightsPerRoute(int maxFlights) Sets the preferred number of flights per route to return.- Parameters:
maxFlights- the preferred number of entries
-
addEquipmentType
Adds an equipment type to search with.- Parameters:
eqType- the aircraft type- See Also:
-
setEquipmentTypes
Updates the equipment types to search with.- Parameters:
eqTypes- a Collection of equipment type codes- See Also:
-
getEquipmentType
Description copied from class:FlightReturns the Equipment type for this flight- Overrides:
getEquipmentTypein classFlight- Returns:
- the equipment code
- See Also:
-
setEquipmentType
Description copied from class:FlightSets the equipment type for this flight.- Overrides:
setEquipmentTypein classFlight- Parameters:
eqType- the aircraft type
-
setIncludeAcademy
Includes Flight Academy flights in the search.- Parameters:
doInclude- an Inclusion
-
setCheckDispatchRoutes
public void setCheckDispatchRoutes(boolean checkDispatch) Checks whether route pairs have Dispatch routes associated with them.- Parameters:
checkDispatch- TRUE if Dispatch routes should be checked, otherwise FALSE
-
setExcludeHistoric
Excludes historic flights form the search.- Parameters:
exHistoric- an Inclusion
-
setDispatchOnly
Includes only flights between airports that have a Dispatch route in the database.- Parameters:
dspOnly- an Inclusion
-
setNotVisitedD
public void setNotVisitedD(boolean nv) Includes only unvisited departure airports.- Parameters:
nv- TRUE if only unvisited departure airports should be included, otherwise FALSE- See Also:
-
setNotVisitedA
public void setNotVisitedA(boolean nv) Includes only unvisited arrival airports.- Parameters:
nv- TRUE if only unvisited arrival airports should be included, otherwise FALSE- See Also:
-
setRouteLegs
public void setRouteLegs(int legs) Sets the number of route legs flown by the pilot.- Parameters:
legs- the number of legs
-
setLastFlownInterval
public void setLastFlownInterval(int days) Sets the interval since the last time the route was flown.- Parameters:
days- the number of days
-