TColumn - column typepublic abstract class UserColumns<TColumn extends UserColumn> extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
UserColumns(String tableName,
List<TColumn> columns,
boolean custom)
Constructor
|
protected |
UserColumns(UserColumns<TColumn> userColumns)
Copy Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addColumn(TColumn column)
Add a new column
|
void |
alterColumn(TColumn column)
Alter a column
|
int |
columnCount()
Get the column count
|
List<TColumn> |
columnsOfType(GeoPackageDataType type)
Get the columns with the provided data type
|
abstract UserColumns<TColumn> |
copy()
Copy the user columns
|
void |
dropColumn(int index)
Drop a column
|
void |
dropColumn(String columnName)
Drop a column
|
void |
dropColumn(TColumn column)
Drop a column
|
protected void |
duplicateCheck(int index,
Integer previousIndex,
String column)
Check for duplicate column names
|
TColumn |
getColumn(int index)
Get the column at the index
|
TColumn |
getColumn(String columnName)
Get the column of the column name
|
int |
getColumnIndex(String columnName)
Get the column index of the column name
|
Integer |
getColumnIndex(String columnName,
boolean required)
Get the column index of the column name
|
String |
getColumnName(int index)
Get the column name at the index
|
String[] |
getColumnNames()
Get the array of column names
|
List<TColumn> |
getColumns()
Get the list of columns
|
TColumn |
getPkColumn()
Get the primary key column
|
int |
getPkColumnIndex()
Get the primary key column index
|
String |
getPkColumnName()
Get the primary key column name
|
String |
getTableName()
Get the table name
|
boolean |
hasColumn(String columnName)
Check if the table has the column
|
boolean |
hasPkColumn()
Check if the table has a primary key column
|
boolean |
isCustom()
Is custom column specification (partial and/or ordering)
|
protected void |
missingCheck(Integer index,
String column)
Check for missing columns
|
void |
renameColumn(int index,
String newColumnName)
Rename a column
|
void |
renameColumn(String columnName,
String newColumnName)
Rename a column
|
void |
renameColumn(TColumn column,
String newColumnName)
Rename a column
|
void |
setCustom(boolean custom)
Set the custom column specification flag
|
void |
setTableName(String tableName)
Set the table name
|
protected void |
typeCheck(GeoPackageDataType expected,
TColumn column)
Check for the expected data type
|
protected void |
updateColumns()
Update the table columns
|
protected UserColumns(String tableName, List<TColumn> columns, boolean custom)
tableName - table namecolumns - columnscustom - custom column specificationprotected UserColumns(UserColumns<TColumn> userColumns)
userColumns - user columnspublic abstract UserColumns<TColumn> copy()
protected void updateColumns()
protected void duplicateCheck(int index,
Integer previousIndex,
String column)
index - indexpreviousIndex - previous indexcolumn - columnprotected void typeCheck(GeoPackageDataType expected, TColumn column)
expected - expected data typecolumn - user columnprotected void missingCheck(Integer index, String column)
index - column indexcolumn - user columnpublic int getColumnIndex(String columnName)
columnName - column namepublic Integer getColumnIndex(String columnName, boolean required)
columnName - column namerequired - column existence is requiredpublic String[] getColumnNames()
public String getColumnName(int index)
index - column indexpublic TColumn getColumn(int index)
index - column indexpublic TColumn getColumn(String columnName)
columnName - column namepublic boolean hasColumn(String columnName)
columnName - column namepublic int columnCount()
public String getTableName()
public void setTableName(String tableName)
tableName - table namepublic boolean isCustom()
public void setCustom(boolean custom)
custom - custom flagpublic boolean hasPkColumn()
public int getPkColumnIndex()
public TColumn getPkColumn()
public String getPkColumnName()
public List<TColumn> columnsOfType(GeoPackageDataType type)
type - data typepublic void addColumn(TColumn column)
column - new columnpublic void renameColumn(TColumn column, String newColumnName)
column - columnnewColumnName - new column namepublic void renameColumn(String columnName, String newColumnName)
columnName - column namenewColumnName - new column namepublic void renameColumn(int index,
String newColumnName)
index - column indexnewColumnName - new column namepublic void dropColumn(TColumn column)
column - column to droppublic void dropColumn(String columnName)
columnName - column namepublic void dropColumn(int index)
index - column indexpublic void alterColumn(TColumn column)
column - altered columnCopyright © 2020 National Geospatial-Intelligence Agency. All rights reserved.