Package PamUtils
Class LatLongDatabaseSet
java.lang.Object
PamUtils.LatLongDatabaseSet
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionLatLongDatabaseSet(String prefix, int verticalOption, boolean useDoubles, boolean shortNames) Construct a set of PamTableItems for writing and reading LatLong data from a database. -
Method Summary
Modifier and TypeMethodDescriptionaddTableItems(EmptyTableDefinition tableDefinition) Add the table items to a PAM Table DefinitiongetLatLongData(SQLTypes sqlTypes) Read the LatLong from the database columns.intintbooleanvoidsetLatLongData(LatLong latLong) Set the position data in the table items.voidsetLongLatName(String longLatName) voidsetLongLongName(String longLongName) voidsetShortLatName(String shortLatName) voidsetShortLongName(String shortLongName) voidsetVerticalName(String verticalName)
-
Field Details
-
VERTICAL_NONE
public static final int VERTICAL_NONE- See Also:
-
VERTICAL_HEIGHT
public static final int VERTICAL_HEIGHT- See Also:
-
VERTICAL_DEPTH
public static final int VERTICAL_DEPTH- See Also:
-
-
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_DEPTHuseDoubles- 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
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
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
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
- Returns:
- the longLatName
-
setLongLatName
- Parameters:
longLatName- the longLatName to set
-
getShortLatName
- Returns:
- the shortLatName
-
setShortLatName
- Parameters:
shortLatName- the shortLatName to set
-
getLongLongName
- Returns:
- the longLongName
-
setLongLongName
- Parameters:
longLongName- the longLongName to set
-
getShortLongName
- Returns:
- the shortLongName
-
setShortLongName
- Parameters:
shortLongName- the shortLongName to set
-
getVerticalName
- Returns:
- the verticalName
-
setVerticalName
- Parameters:
verticalName- the verticalName to set
-
getVerticalOption
public int getVerticalOption()- Returns:
- the verticalOption
-
isShortNames
public boolean isShortNames()- Returns:
- the shortNames
-
getLatTableItem
- Returns:
- the latTableItem
-
getLongTableItem
- Returns:
- the longTableItem
-
getVertTableItem
- Returns:
- the vertTableItem
-
getSqlType
public int getSqlType()- Returns:
- the sqlType
-