Package PamUtils

Class LatLongDatabaseSet

java.lang.Object
PamUtils.LatLongDatabaseSet

public class LatLongDatabaseSet extends Object
Set of functions to set up reading and writing of latitude longitude and depth data to a database table. Saves repeating lots of code lots of time.
Author:
dg50
  • Field Details

  • Constructor Details

    • LatLongDatabaseSet

      public LatLongDatabaseSet(String prefix, int verticalOption, boolean useDoubles, boolean shortNames)
      Construct a set of PamTableItems for writing and reading LatLong data from a database.
      Parameters:
      prefix - prefix to add to start of each column name.
      verticalOption - can be one of VERTICAL_NONE, VERTICAL_HEIGHT or VERTCAI_DEPTH
      useDoubles - write double values, otherwise will be float which has an effort of about 1.5m at 180 deg. E or W.
      shortNames - short names ("Lat", "Lon" instead of "Latitude", "Longitude").
  • Method Details

    • addTableItems

      public PamTableItem[] addTableItems(EmptyTableDefinition tableDefinition)
      Add the table items to a PAM Table Definition
      Parameters:
      tableDefinition - table definition
      Returns:
      added table items (you should never need to access these directly).
    • setLatLongData

      public void setLatLongData(LatLong latLong)
      Set the position data in the table items. Generally this will be called from SQLLogging.setTableData(...)
      Parameters:
      latLong - lat long, can be null in which case null will be written to each column.
    • getLatLongData

      public LatLong getLatLongData(SQLTypes sqlTypes)
      Read the LatLong from the database columns. Generally this will be called from SQLLogging.createDataUnit(...)
      Parameters:
      sqlTypes - SQLTypes from database connection (probably not needed)
      Returns:
      LatLong object or null if either the Lat or Long columns have a null value. If the vertical is null, the LatLong will still be returned with 0 height.
    • getLongLatName

      public String getLongLatName()
      Returns:
      the longLatName
    • setLongLatName

      public void setLongLatName(String longLatName)
      Parameters:
      longLatName - the longLatName to set
    • getShortLatName

      public String getShortLatName()
      Returns:
      the shortLatName
    • setShortLatName

      public void setShortLatName(String shortLatName)
      Parameters:
      shortLatName - the shortLatName to set
    • getLongLongName

      public String getLongLongName()
      Returns:
      the longLongName
    • setLongLongName

      public void setLongLongName(String longLongName)
      Parameters:
      longLongName - the longLongName to set
    • getShortLongName

      public String getShortLongName()
      Returns:
      the shortLongName
    • setShortLongName

      public void setShortLongName(String shortLongName)
      Parameters:
      shortLongName - the shortLongName to set
    • getVerticalName

      public String getVerticalName()
      Returns:
      the verticalName
    • setVerticalName

      public void setVerticalName(String verticalName)
      Parameters:
      verticalName - the verticalName to set
    • getVerticalOption

      public int getVerticalOption()
      Returns:
      the verticalOption
    • isShortNames

      public boolean isShortNames()
      Returns:
      the shortNames
    • getLatTableItem

      public PamTableItem getLatTableItem()
      Returns:
      the latTableItem
    • getLongTableItem

      public PamTableItem getLongTableItem()
      Returns:
      the longTableItem
    • getVertTableItem

      public PamTableItem getVertTableItem()
      Returns:
      the vertTableItem
    • getSqlType

      public int getSqlType()
      Returns:
      the sqlType