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:
- 11.4
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.deltava.beans.schedule.RoutePair
RoutePair.RoutePairImpl
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScheduleSearchCriteria
(String sortBy) Initializes the search criteria.ScheduleSearchCriteria
(Airline a, int fNumber, int leg) Initializes the search criteria. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addEquipmentType
(String eqType) Adds an equipment type to search with.boolean
Returns the database to search.Returns whether to search for flights with dispatch flight plans.final int
Returns the distance between the Airports.final int
final Duration
DISABLED property.final String
Returns the Equipment type for this flightReturns the equipment types to search for.Returns whether to exclude historic flights from the search.int
Returns the maximum number of schedule entries per route to return.int
getHourA()
int
getHourD()
Returns whether to include Flight Academy flights in the search.int
final int
A method to return the length of the flight in hours multiplied by 10.int
Returns the maximum numnber of schedule entries to return.boolean
Returns whether to only search routes including an airport not previously visited.boolean
Returns whether to only search routes including an airport not previously visited.int
Returns the Pilot ID, if filtering for unvisited airports.int
Returns the SQL sorting clause.getTimeA()
getTimeD()
boolean
Returns whether this is a search by leg or by route.void
setCheckDispatchRoutes
(boolean checkDispatch) Checks whether route pairs have Dispatch routes associated with them.void
Updates the database to search.void
setDispatchOnly
(Inclusion dspOnly) Includes only flights between airports that have a Dispatch route in the database.void
setDistance
(int distance) Sets the distance of the flight.void
setDistanceRange
(int range) Sets the distance range of the flight.final void
setEquipmentType
(String eqType) Sets the equipment type for this flight.void
setEquipmentTypes
(Collection<String> eqTypes) Updates the equipment types to search with.void
setExcludeHistoric
(Inclusion exHistoric) Excludes historic flights form the search.void
setFlightsPerRoute
(int maxFlights) Sets the preferred number of flights per route to return.void
setHourA
(int hour) void
setHourD
(int hour) void
setIncludeAcademy
(Inclusion doInclude) Includes Flight Academy flights in the search.void
setLastFlownInterval
(int days) Sets the interval since the last time the route was flown.void
setLength
(int length) Sets the length of the flight.void
setMaxResults
(int results) Sets the maximum number of schedule entries to return.void
setNotVisitedA
(boolean nv) Includes only unvisited arrival airports.void
setNotVisitedD
(boolean nv) Includes only unvisited departure airports.void
setPilotID
(int id) The Pilot database ID, if filtering for unvisited airports.void
setRouteLegs
(int legs) Sets the number of route legs flown by the pilot.void
Methods inherited from class org.deltava.beans.Flight
compareTo, equals, getAirline, getAirportA, getAirportD, getCallsign, getFlightCode, getFlightNumber, getLeg, getLegCode, getShortCode, hashCode, setAirline, setAirportA, setAirportD, setFlightNumber, setLeg, toString
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, getID, setID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirports, getFlightType, includes, isPopulated, matches
-
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:RoutePair
Returns the distance between the Airports.- Specified by:
getDistance
in interfaceRoutePair
- Overrides:
getDistance
in classFlight
- Returns:
- the distance in miles
-
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:
getDuration
in 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:Flight
Returns the Equipment type for this flight- Overrides:
getEquipmentType
in classFlight
- Returns:
- the equipment code
- See Also:
-
setEquipmentType
Description copied from class:Flight
Sets the equipment type for this flight.- Overrides:
setEquipmentType
in 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
-