Package mil.nga.geopackage.user
Class UserColumns<TColumn extends UserColumn>
- java.lang.Object
- 
- mil.nga.geopackage.user.UserColumns<TColumn>
 
- 
- Type Parameters:
- TColumn- column type
 - Direct Known Subclasses:
- AttributesColumns,- FeatureColumns,- TileColumns,- UserCustomColumns
 
 public abstract class UserColumns<TColumn extends UserColumn> extends Object Abstract collection of columns from a user table, representing a full set of table columns or a subset from a query- Since:
- 3.5.0
- Author:
- osbornb
 
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedUserColumns(String tableName, List<TColumn> columns, boolean custom)ConstructorprotectedUserColumns(UserColumns<TColumn> userColumns)Copy Constructor
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddColumn(TColumn column)Add a new columnvoidalterColumn(TColumn column)Alter a columnintcolumnCount()Get the column countList<TColumn>columnsOfType(GeoPackageDataType type)Get the columns with the provided data typeabstract UserColumns<TColumn>copy()Copy the user columnsvoiddropColumn(int index)Drop a columnvoiddropColumn(String columnName)Drop a columnvoiddropColumn(TColumn column)Drop a columnprotected voidduplicateCheck(int index, Integer previousIndex, String column)Check for duplicate column namesTColumngetColumn(int index)Get the column at the indexTColumngetColumn(String columnName)Get the column of the column nameintgetColumnIndex(String columnName)Get the column index of the column nameIntegergetColumnIndex(String columnName, boolean required)Get the column index of the column nameStringgetColumnName(int index)Get the column name at the indexString[]getColumnNames()Get the array of column namesList<TColumn>getColumns()Get the list of columnsTColumngetPkColumn()Get the primary key columnintgetPkColumnIndex()Get the primary key column indexStringgetPkColumnName()Get the primary key column nameStringgetTableName()Get the table namebooleanhasColumn(String columnName)Check if the table has the columnbooleanhasPkColumn()Check if the table has a primary key columnbooleanhasSchema()Check if any columns have an in-memory data columns schemabooleanisCustom()Is custom column specification (partial and/or ordering)booleanisPkModifiable()Is the primary key modifiablebooleanisValueValidation()Is value validation against column types enabledprotected voidmissingCheck(Integer index, String column)Check for missing columnsvoidrenameColumn(int index, String newColumnName)Rename a columnvoidrenameColumn(String columnName, String newColumnName)Rename a columnvoidrenameColumn(TColumn column, String newColumnName)Rename a columnvoidsetCustom(boolean custom)Set the custom column specification flagvoidsetPkModifiable(boolean pkModifiable)Set if the primary key can be modifiedvoidsetTableName(String tableName)Set the table namevoidsetValueValidation(boolean valueValidation)Set if values should validated against column typesprotected voidtypeCheck(GeoPackageDataType expected, TColumn column)Check for the expected data typeprotected voidupdateColumns()Update the table columns
 
- 
- 
- 
Constructor Detail- 
UserColumnsprotected UserColumns(String tableName, List<TColumn> columns, boolean custom) Constructor- Parameters:
- tableName- table name
- columns- columns
- custom- custom column specification
 
 - 
UserColumnsprotected UserColumns(UserColumns<TColumn> userColumns) Copy Constructor- Parameters:
- userColumns- user columns
 
 
- 
 - 
Method Detail- 
copypublic abstract UserColumns<TColumn> copy() Copy the user columns- Returns:
- copied user columns
 
 - 
updateColumnsprotected void updateColumns() Update the table columns
 - 
duplicateCheckprotected void duplicateCheck(int index, Integer previousIndex, String column)Check for duplicate column names- Parameters:
- index- index
- previousIndex- previous index
- column- column
 
 - 
typeCheckprotected void typeCheck(GeoPackageDataType expected, TColumn column) Check for the expected data type- Parameters:
- expected- expected data type
- column- user column
 
 - 
missingCheckprotected void missingCheck(Integer index, String column) Check for missing columns- Parameters:
- index- column index
- column- user column
 
 - 
getColumnIndexpublic int getColumnIndex(String columnName) Get the column index of the column name- Parameters:
- columnName- column name
- Returns:
- column index
 
 - 
getColumnIndexpublic Integer getColumnIndex(String columnName, boolean required) Get the column index of the column name- Parameters:
- columnName- column name
- required- column existence is required
- Returns:
- column index
 
 - 
getColumnNamespublic String[] getColumnNames() Get the array of column names- Returns:
- column names
 
 - 
getColumnNamepublic String getColumnName(int index) Get the column name at the index- Parameters:
- index- column index
- Returns:
- column name
 
 - 
getColumnpublic TColumn getColumn(int index) Get the column at the index- Parameters:
- index- column index
- Returns:
- column
 
 - 
getColumnpublic TColumn getColumn(String columnName) Get the column of the column name- Parameters:
- columnName- column name
- Returns:
- column
 
 - 
hasColumnpublic boolean hasColumn(String columnName) Check if the table has the column- Parameters:
- columnName- column name
- Returns:
- true if has the column
 
 - 
columnCountpublic int columnCount() Get the column count- Returns:
- column count
 
 - 
getTableNamepublic String getTableName() Get the table name- Returns:
- table name
 
 - 
setTableNamepublic void setTableName(String tableName) Set the table name- Parameters:
- tableName- table name
 
 - 
isCustompublic boolean isCustom() Is custom column specification (partial and/or ordering)- Returns:
- custom flag
 
 - 
setCustompublic void setCustom(boolean custom) Set the custom column specification flag- Parameters:
- custom- custom flag
 
 - 
hasPkColumnpublic boolean hasPkColumn() Check if the table has a primary key column- Returns:
- true if has a primary key
 
 - 
getPkColumnIndexpublic int getPkColumnIndex() Get the primary key column index- Returns:
- primary key column index
 
 - 
getPkColumnpublic TColumn getPkColumn() Get the primary key column- Returns:
- primary key column
 
 - 
getPkColumnNamepublic String getPkColumnName() Get the primary key column name- Returns:
- primary key column name
 
 - 
columnsOfTypepublic List<TColumn> columnsOfType(GeoPackageDataType type) Get the columns with the provided data type- Parameters:
- type- data type
- Returns:
- columns
 
 - 
isPkModifiablepublic boolean isPkModifiable() Is the primary key modifiable- Returns:
- true if the primary key is modifiable
- Since:
- 4.0.0
 
 - 
setPkModifiablepublic void setPkModifiable(boolean pkModifiable) Set if the primary key can be modified- Parameters:
- pkModifiable- primary key modifiable flag
- Since:
- 4.0.0
 
 - 
isValueValidationpublic boolean isValueValidation() Is value validation against column types enabled- Returns:
- true if values are validated against column types
- Since:
- 4.0.0
 
 - 
setValueValidationpublic void setValueValidation(boolean valueValidation) Set if values should validated against column types- Parameters:
- valueValidation- value validation flag
- Since:
- 4.0.0
 
 - 
addColumnpublic void addColumn(TColumn column) Add a new column- Parameters:
- column- new column
 
 - 
renameColumnpublic void renameColumn(TColumn column, String newColumnName) Rename a column- Parameters:
- column- column
- newColumnName- new column name
 
 - 
renameColumnpublic void renameColumn(String columnName, String newColumnName) Rename a column- Parameters:
- columnName- column name
- newColumnName- new column name
 
 - 
renameColumnpublic void renameColumn(int index, String newColumnName)Rename a column- Parameters:
- index- column index
- newColumnName- new column name
 
 - 
dropColumnpublic void dropColumn(TColumn column) Drop a column- Parameters:
- column- column to drop
 
 - 
dropColumnpublic void dropColumn(String columnName) Drop a column- Parameters:
- columnName- column name
 
 - 
dropColumnpublic void dropColumn(int index) Drop a column- Parameters:
- index- column index
 
 - 
alterColumnpublic void alterColumn(TColumn column) Alter a column- Parameters:
- column- altered column
 
 - 
hasSchemapublic boolean hasSchema() Check if any columns have an in-memory data columns schema- Returns:
- true if has a column schema
- Since:
- 6.6.7
 
 
- 
 
-