Class ContentsIdExtension
- java.lang.Object
-
- mil.nga.geopackage.extension.BaseExtension
-
- mil.nga.geopackage.extension.nga.contents.ContentsIdExtension
-
public class ContentsIdExtension extends BaseExtension
This extension assigns a unique integer identifier to tables defined in the contents. Allows foreign key referencing to a contents (text based primary key) by an integer identifier. http://ngageoint.github.io/GeoPackage/docs/extensions/contents-id.html- Since:
- 3.2.0
- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXTENSION_AUTHORExtension authorstatic StringEXTENSION_DEFINITIONExtension definition URLstatic StringEXTENSION_NAMEExtension, with author and namestatic StringEXTENSION_NAME_NO_AUTHORExtension name without the author-
Fields inherited from class mil.nga.geopackage.extension.BaseExtension
extensionsDao, geoPackage
-
-
Constructor Summary
Constructors Constructor Description ContentsIdExtension(GeoPackageCore geoPackage)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longcount()Get the count of contents idsContentsIdcreate(String tableName)Create a contents idContentsIdcreate(Contents contents)Create a contents idbooleancreateContentsIdTable()Create the Contents Id Table if it does not existlongcreateId(String tableName)Create a contents idlongcreateId(Contents contents)Create a contents idintcreateIds()Create contents ids for contents currently withoutintcreateIds(String type)Create contents ids for contents of the data type and currently withoutintcreateIds(ContentsDataType type)Create contents ids for contents of the data type and currently withoutbooleandelete(String tableName)Delete the contents id for the tablebooleandelete(Contents contents)Delete the contents id for the contentsintdeleteIds()Delete all contents idsintdeleteIds(String type)Delete contents ids for contents of the data typeintdeleteIds(ContentsDataType type)Delete contents ids for contents of the data typeContentsIdget(String tableName)Get the contents id objectContentsIdget(Contents contents)Get the contents id objectContentsIdDaogetContentsIdDao()Get a Contents Id DAOstatic ContentsIdDaogetContentsIdDao(GeoPackageCoreConnection db)Get a Contents Id DAOstatic ContentsIdDaogetContentsIdDao(GeoPackageCore geoPackage)Get a Contents Id DAOContentsIdDaogetDao()Get the contents id DAOExtensionsgetExtension()Get the extensionLonggetId(String tableName)Get the contents idLonggetId(Contents contents)Get the contents idList<ContentsId>getIds()Get all contents idsList<ContentsId>getIds(String type)Get by contents data typeList<ContentsId>getIds(ContentsDataType type)Get by contents data typeList<String>getMissing()Get contents without contents idsList<String>getMissing(String type)Get contents by data type without contents idsList<String>getMissing(ContentsDataType type)Get contents by data type without contents idsContentsIdgetOrCreate(String tableName)Get or create a contents idContentsIdgetOrCreate(Contents contents)Get or create a contents idExtensionsgetOrCreateExtension()Get or create if needed the extensionlonggetOrCreateId(String tableName)Get or create a contents idlonggetOrCreateId(Contents contents)Get or create a contents idbooleanhas()Determine if the GeoPackage has the extensionvoidremoveExtension()Remove all trace of the extension-
Methods inherited from class mil.nga.geopackage.extension.BaseExtension
createDao, get, getExtensions, getExtensions, getExtensionsDao, getGeoPackage, getOrCreate, has, has, has, verifyWritable
-
-
-
-
Field Detail
-
EXTENSION_AUTHOR
public static final String EXTENSION_AUTHOR
Extension author- See Also:
- Constant Field Values
-
EXTENSION_NAME_NO_AUTHOR
public static final String EXTENSION_NAME_NO_AUTHOR
Extension name without the author- See Also:
- Constant Field Values
-
EXTENSION_NAME
public static final String EXTENSION_NAME
Extension, with author and name
-
EXTENSION_DEFINITION
public static final String EXTENSION_DEFINITION
Extension definition URL
-
-
Constructor Detail
-
ContentsIdExtension
public ContentsIdExtension(GeoPackageCore geoPackage)
Constructor- Parameters:
geoPackage- GeoPackage
-
-
Method Detail
-
getDao
public ContentsIdDao getDao()
Get the contents id DAO- Returns:
- dao
-
has
public boolean has()
Determine if the GeoPackage has the extension- Returns:
- true if has extension
-
get
public ContentsId get(Contents contents)
Get the contents id object- Parameters:
contents- contents- Returns:
- contents id or null
-
get
public ContentsId get(String tableName)
Get the contents id object- Parameters:
tableName- table name- Returns:
- contents id or null
-
getId
public Long getId(Contents contents)
Get the contents id- Parameters:
contents- contents- Returns:
- contents id or null
-
getId
public Long getId(String tableName)
Get the contents id- Parameters:
tableName- table name- Returns:
- contents id or null
-
create
public ContentsId create(Contents contents)
Create a contents id- Parameters:
contents- contents- Returns:
- new contents id
-
create
public ContentsId create(String tableName)
Create a contents id- Parameters:
tableName- table name- Returns:
- new contents id
-
createId
public long createId(Contents contents)
Create a contents id- Parameters:
contents- contents- Returns:
- new contents id
-
createId
public long createId(String tableName)
Create a contents id- Parameters:
tableName- table name- Returns:
- new contents id
-
getOrCreate
public ContentsId getOrCreate(Contents contents)
Get or create a contents id- Parameters:
contents- contents- Returns:
- new or existing contents id
-
getOrCreate
public ContentsId getOrCreate(String tableName)
Get or create a contents id- Parameters:
tableName- table name- Returns:
- new or existing contents id
-
getOrCreateId
public long getOrCreateId(Contents contents)
Get or create a contents id- Parameters:
contents- contents- Returns:
- new or existing contents id
-
getOrCreateId
public long getOrCreateId(String tableName)
Get or create a contents id- Parameters:
tableName- table name- Returns:
- new or existing contents id
-
delete
public boolean delete(Contents contents)
Delete the contents id for the contents- Parameters:
contents- contents- Returns:
- true if deleted
-
delete
public boolean delete(String tableName)
Delete the contents id for the table- Parameters:
tableName- table name- Returns:
- true if deleted
-
createIds
public int createIds()
Create contents ids for contents currently without- Returns:
- newly created contents ids count
-
createIds
public int createIds(ContentsDataType type)
Create contents ids for contents of the data type and currently without- Parameters:
type- contents data type- Returns:
- newly created contents ids count
-
createIds
public int createIds(String type)
Create contents ids for contents of the data type and currently without- Parameters:
type- contents data type- Returns:
- newly created contents ids count
-
deleteIds
public int deleteIds()
Delete all contents ids- Returns:
- deleted contents ids count
-
deleteIds
public int deleteIds(ContentsDataType type)
Delete contents ids for contents of the data type- Parameters:
type- contents data type- Returns:
- deleted contents ids count
-
deleteIds
public int deleteIds(String type)
Delete contents ids for contents of the data type- Parameters:
type- contents data type- Returns:
- deleted contents ids count
-
getIds
public List<ContentsId> getIds()
Get all contents ids- Returns:
- contents ids
-
count
public long count()
Get the count of contents ids- Returns:
- count
-
getIds
public List<ContentsId> getIds(ContentsDataType type)
Get by contents data type- Parameters:
type- contents data type- Returns:
- contents ids
-
getIds
public List<ContentsId> getIds(String type)
Get by contents data type- Parameters:
type- contents data type- Returns:
- contents ids
-
getMissing
public List<String> getMissing()
Get contents without contents ids- Returns:
- table names without contents ids
-
getMissing
public List<String> getMissing(ContentsDataType type)
Get contents by data type without contents ids- Parameters:
type- contents data type- Returns:
- table names without contents ids
-
getMissing
public List<String> getMissing(String type)
Get contents by data type without contents ids- Parameters:
type- contents data type- Returns:
- table names without contents ids
-
getOrCreateExtension
public Extensions getOrCreateExtension()
Get or create if needed the extension- Returns:
- extensions object
-
getExtension
public Extensions getExtension()
Get the extension- Returns:
- extensions object or null if one does not exist
-
removeExtension
public void removeExtension()
Remove all trace of the extension
-
getContentsIdDao
public ContentsIdDao getContentsIdDao()
Get a Contents Id DAO- Returns:
- contents id dao
- Since:
- 4.0.0
-
getContentsIdDao
public static ContentsIdDao getContentsIdDao(GeoPackageCore geoPackage)
Get a Contents Id DAO- Parameters:
geoPackage- GeoPackage- Returns:
- contents id dao
- Since:
- 4.0.0
-
getContentsIdDao
public static ContentsIdDao getContentsIdDao(GeoPackageCoreConnection db)
Get a Contents Id DAO- Parameters:
db- database connection- Returns:
- contents id dao
- Since:
- 4.0.0
-
createContentsIdTable
public boolean createContentsIdTable()
Create the Contents Id Table if it does not exist- Returns:
- true if created
- Since:
- 4.0.0
-
-