Package mil.nga.geopackage.db.table
Class TableInfo
- java.lang.Object
- 
- mil.nga.geopackage.db.table.TableInfo
 
- 
 public class TableInfo extends Object Table Info queries (table_info)- Since:
- 3.3.0
- Author:
- osbornb
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringCIDIndex columnstatic intCID_INDEXIndex column indexstatic StringDEFAULT_NULLDefault of NULL valuestatic StringDFLT_VALUEDefault value columnstatic intDFLT_VALUE_INDEXDefault value column indexstatic StringNAMEName columnstatic intNAME_INDEXName column indexstatic StringNOT_NULLNot null columnstatic intNOT_NULL_INDEXNot null column indexstatic StringPKPrimary key columnstatic intPK_INDEXPrimary key column indexstatic StringTYPEType columnstatic intTYPE_INDEXType column index
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TableColumngetColumn(int index)Get the column at the indexTableColumngetColumn(String name)Get the column with the nameList<TableColumn>getColumns()Get the columnsstatic GeoPackageDataTypegetDataType(String type)Get the data type from the type valuestatic ObjectgetDefaultValue(String defaultValue, String type)Get the default object value for the string default value and typestatic ObjectgetDefaultValue(String defaultValue, GeoPackageDataType type)Get the default object value for the string default value with the data typeTableColumngetPrimaryKey()Get the single or first primary key if one existsList<TableColumn>getPrimaryKeys()Get the primary key columnsStringgetTableName()Get the table namebooleanhasColumn(String name)Check if the table has the columnbooleanhasPrimaryKey()Check if the table has one or more primary keysstatic TableInfoinfo(GeoPackageCoreConnection db, String tableName)Query for the table_info of the table nameintnumColumns()Number of columns
 
- 
- 
- 
Field Detail- 
CIDpublic static final String CID Index column- See Also:
- Constant Field Values
 
 - 
CID_INDEXpublic static final int CID_INDEX Index column index- See Also:
- Constant Field Values
 
 - 
NAMEpublic static final String NAME Name column- See Also:
- Constant Field Values
 
 - 
NAME_INDEXpublic static final int NAME_INDEX Name column index- See Also:
- Constant Field Values
 
 - 
TYPEpublic static final String TYPE Type column- See Also:
- Constant Field Values
 
 - 
TYPE_INDEXpublic static final int TYPE_INDEX Type column index- See Also:
- Constant Field Values
 
 - 
NOT_NULLpublic static final String NOT_NULL Not null column- See Also:
- Constant Field Values
 
 - 
NOT_NULL_INDEXpublic static final int NOT_NULL_INDEX Not null column index- See Also:
- Constant Field Values
 
 - 
DFLT_VALUEpublic static final String DFLT_VALUE Default value column- See Also:
- Constant Field Values
 
 - 
DFLT_VALUE_INDEXpublic static final int DFLT_VALUE_INDEX Default value column index- See Also:
- Constant Field Values
 
 - 
PKpublic static final String PK Primary key column- See Also:
- Constant Field Values
 
 - 
PK_INDEXpublic static final int PK_INDEX Primary key column index- See Also:
- Constant Field Values
 
 - 
DEFAULT_NULLpublic static final String DEFAULT_NULL Default of NULL value- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getTableNamepublic String getTableName() Get the table name- Returns:
- table name
 
 - 
numColumnspublic int numColumns() Number of columns- Returns:
- column count
 
 - 
getColumnspublic List<TableColumn> getColumns() Get the columns- Returns:
- columns
 
 - 
getColumnpublic TableColumn getColumn(int index) Get the column at the index- Parameters:
- index- column index
- Returns:
- column
 
 - 
hasColumnpublic boolean hasColumn(String name) Check if the table has the column- Parameters:
- name- column name
- Returns:
- true if has column
 
 - 
getColumnpublic TableColumn getColumn(String name) Get the column with the name- Parameters:
- name- column name
- Returns:
- column or null if does not exist
 
 - 
hasPrimaryKeypublic boolean hasPrimaryKey() Check if the table has one or more primary keys- Returns:
- true if has at least one primary key
 
 - 
getPrimaryKeyspublic List<TableColumn> getPrimaryKeys() Get the primary key columns- Returns:
- primary key columns
 
 - 
getPrimaryKeypublic TableColumn getPrimaryKey() Get the single or first primary key if one exists- Returns:
- single or first primary key, null if no primary key
 
 - 
infopublic static TableInfo info(GeoPackageCoreConnection db, String tableName) Query for the table_info of the table name- Parameters:
- db- connection
- tableName- table name
- Returns:
- table info or null if no table
 
 - 
getDataTypepublic static GeoPackageDataType getDataType(String type) Get the data type from the type value- Parameters:
- type- type value
- Returns:
- data type or null
 
 - 
getDefaultValuepublic static Object getDefaultValue(String defaultValue, String type) Get the default object value for the string default value and type- Parameters:
- defaultValue- default value
- type- type
- Returns:
- default value
 
 - 
getDefaultValuepublic static Object getDefaultValue(String defaultValue, GeoPackageDataType type) Get the default object value for the string default value with the data type- Parameters:
- defaultValue- default value
- type- data type
- Returns:
- default value
 
 
- 
 
-