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

public class ScheduleSearchCriteria extends Flight
A bean to store search criteria for the Flight Schedule.
Since:
1.0
Version:
11.4
Author:
Luke
See Also:
  • Field Details

    • SORT_CODES

      public static final String[] SORT_CODES
    • SORT_OPTIONS

      public static final List<?> SORT_OPTIONS
    • HOURS

      public static final List<?> HOURS
  • Constructor Details

    • ScheduleSearchCriteria

      public ScheduleSearchCriteria(Airline a, int fNumber, int leg)
      Initializes the search criteria.
      Parameters:
      a - the Airline
      fNumber - the flight number
      leg - the leg number
    • ScheduleSearchCriteria

      public ScheduleSearchCriteria(String sortBy)
      Initializes the search criteria.
      Parameters:
      sortBy - the sorting SQL clause
  • Method Details

    • getDBName

      public String getDBName()
      Returns the database to search.
      Returns:
      the database name
    • getSortBy

      public String getSortBy()
      Returns the SQL sorting clause.
      Returns:
      the sorting SQL
    • getDistance

      public final int getDistance()
      Description copied from interface: RoutePair
      Returns the distance between the Airports.
      Specified by:
      getDistance in interface RoutePair
      Overrides:
      getDistance in class Flight
      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

      public Inclusion getExcludeHistoric()
      Returns whether to exclude historic flights from the search.
      Returns:
      an Inclusion
    • getDispatchOnly

      public Inclusion getDispatchOnly()
      Returns whether to search for flights with dispatch flight plans.
      Returns:
      an Inclusion
    • getIncludeAcademy

      public 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

      public Instant getTimeD()
    • getHourD

      public int getHourD()
    • getTimeA

      public Instant getTimeA()
    • getHourA

      public int getHourA()
    • getLength

      public final int getLength()
      Description copied from class: Flight
      A method to return the length of the flight in hours multiplied by 10.
      Specified by:
      getLength in class Flight
      Returns:
      the length of the flight
    • getDuration

      public final Duration getDuration()
      DISABLED property.
      Specified by:
      getDuration in class Flight
      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

      public void setSortBy(String sortBy)
    • setHourD

      public void setHourD(int hour)
    • setHourA

      public void setHourA(int hour)
    • getEquipmentTypes

      public Collection<String> getEquipmentTypes()
      Returns the equipment types to search for.
      Returns:
      a Collection of equipment type names
    • setDBName

      public void setDBName(String db)
      Updates the database to search.
      Parameters:
      db - the database name
    • 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

      public void addEquipmentType(String eqType)
      Adds an equipment type to search with.
      Parameters:
      eqType - the aircraft type
      See Also:
    • setEquipmentTypes

      public void setEquipmentTypes(Collection<String> eqTypes)
      Updates the equipment types to search with.
      Parameters:
      eqTypes - a Collection of equipment type codes
      See Also:
    • getEquipmentType

      public final String getEquipmentType()
      Description copied from class: Flight
      Returns the Equipment type for this flight
      Overrides:
      getEquipmentType in class Flight
      Returns:
      the equipment code
      See Also:
    • setEquipmentType

      public final void setEquipmentType(String eqType)
      Description copied from class: Flight
      Sets the equipment type for this flight.
      Overrides:
      setEquipmentType in class Flight
      Parameters:
      eqType - the aircraft type
    • setIncludeAcademy

      public void setIncludeAcademy(Inclusion doInclude)
      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

      public void setExcludeHistoric(Inclusion exHistoric)
      Excludes historic flights form the search.
      Parameters:
      exHistoric - an Inclusion
    • setDispatchOnly

      public void setDispatchOnly(Inclusion dspOnly)
      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