Class GetNavData

java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.GetNavData
Direct Known Subclasses:
GetNavAirway

public class GetNavData extends DAO
A Data Access Object to read Navigation data.
Since:
1.0
Version:
11.4
Author:
Luke
  • Constructor Details

    • GetNavData

      public GetNavData(Connection c)
      Initializes the Data Access Object.
      Parameters:
      c - the JDBC connection to use
  • Method Details

    • get

      public NavigationDataMap get(String code) throws DAOException
      Returns a Navigation object.
      Parameters:
      code - the object code
      Returns:
      a NavigationDataMap
      Throws:
      DAOException - if a JDBC error occurs
    • getBearingRange

      public NavigationDataMap getBearingRange(String code) throws DAOException
      Retrieves "special" navaids such as CODE[bearing][distance].
      Parameters:
      code - the code/bearing/distance
      Returns:
      a NavigationDataMap
      Throws:
      DAOException - if a JDBC error occurs
    • getAirport

      public AirportLocation getAirport(String code) throws DAOException
      Returns an Airport location from the database.
      Parameters:
      code - the airport ICAO code
      Returns:
      an AirportLocation bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getAll

      public Collection<NavigationDataBean> getAll(Navaid type) throws DAOException
      Returns all navaids of a particular type in the database.
      Parameters:
      type - the Navaid
      Returns:
      a Collection of NavigationDataBeans
      Throws:
      DAOException - if a JDBC error occurs
    • getRunways

      public List<Runway> getRunways() throws DAOException
      Returns all Runways in the database.
      Returns:
      a List of Runways
      Throws:
      DAOException - if a JDBC error occurs
    • getRunway

      public Runway getRunway(ICAOAirport a, String rwyCode, Simulator sim) throws DAOException
      Returns information about a particular airport Runway.
      Parameters:
      a - the ICAOAirport
      rwyCode - the runway name/number
      sim - the Simulator to select
      Returns:
      a Runway bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getRunways

      public List<Runway> getRunways(ICAOAirport a, Simulator sim) throws DAOException
      Returns all Runways for a particular Airport.
      Parameters:
      a - the ICAOAirport
      sim - the Simulator to select
      Returns:
      a Collection of Runway beans
      Throws:
      DAOException - if a JDBC error occurs
    • getBestRunway

      public LandingRunways getBestRunway(ICAOAirport a, Simulator sim, GeoLocation loc, int hdg) throws DAOException
      Returns the likeliest runway for a takeoff or landing.
      Parameters:
      a - the Airport
      sim - the Simulator
      loc - the takeoff/landing location
      hdg - the takeoff/landing heading in degrees
      Returns:
      a Runway, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getByID

      public NavigationDataMap getByID(Collection<String> ids) throws DAOException
      Returns a group of Navigation objects.
      Parameters:
      ids - a Collection of navigation object codes
      Returns:
      a NavigationDataMap bean
      Throws:
      DAOException - if a JDBC error occurs
    • getIntersections

      public Collection<NavigationDataBean> getIntersections(GeoLocation loc, int distance) throws DAOException
      Returns all Intersections within a set number of miles from a point.
      Parameters:
      loc - the central location
      distance - the distance in miles
      Returns:
      a Map of Intersections, with the code as the key
      Throws:
      DAOException - if a JDBC error occurs
      IllegalArgumentException - if distance is negative or > 1000
    • getObjects

      public Collection<NavigationDataBean> getObjects(GeoLocation loc, int distance) throws DAOException
      Returns all Navigation objects (except Intersections/Runways/Gates) within a set number of miles from a point.
      Parameters:
      loc - the central location
      distance - the distance in miles
      Returns:
      a Map of NavigationDataBeans, with the code as the key
      Throws:
      DAOException - if a JDBC error occurs
      IllegalArgumentException - if distance is negative or > 1500