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.RoutePairImpl -
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, toStringMethods inherited from class DatabaseBean
cacheKey, getHexID, getID, setID, validateID, validateIDMethods inherited from interface RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches, midPoint
-
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
-