Package mil.nga.geopackage.user
Class UserCoreRow<TColumn extends UserColumn,TTable extends UserTable<TColumn>>
- java.lang.Object
-
- mil.nga.geopackage.user.UserCoreRow<TColumn,TTable>
-
- Type Parameters:
TColumn- column typeTTable- table type
public abstract class UserCoreRow<TColumn extends UserColumn,TTable extends UserTable<TColumn>> extends Object
User Row containing the values from a single cursor row- Author:
- osbornb
-
-
Field Summary
Fields Modifier and Type Field Description protected UserColumns<TColumn>columnsUser columnsprotected int[]columnTypesCursor column types of this row, based upon the data valuesprotected TTabletableUser tableprotected Object[]valuesArray of row values
-
Constructor Summary
Constructors Modifier Constructor Description protectedUserCoreRow(UserCoreRow<TColumn,TTable> userCoreRow)Copy ConstructorprotectedUserCoreRow(TTable table)Constructor to create an empty rowprotectedUserCoreRow(TTable table, UserColumns<TColumn> columns, int[] columnTypes, Object[] values)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcolumnCount()Get the column countprotected ObjectcopyValue(TColumn column, Object value)Copy the value of the data typeSet<Map.Entry<String,ColumnValue>>getAsMap()Get a MapTColumngetColumn(int index)Get the column at the indexTColumngetColumn(String columnName)Get the column of the column nameintgetColumnIndex(String columnName)Get the index of the column nameStringgetColumnName(int index)Get the column name at the indexString[]getColumnNames()Get the column namesUserColumns<TColumn>getColumns()Get the columnslonggetId()Get the id value, which is the value of the primary keyTColumngetPkColumn()Get the primary key columnintgetPkColumnIndex()Get the primary key column indexintgetRowColumnType(int index)Get the Cursor column data type at the indexintgetRowColumnType(String columnName)Get the Cursor column data type of the column nameint[]getRowColumnTypes()Get the row column data typesTTablegetTable()Get the tableObjectgetValue(int index)Get the value at the indexObjectgetValue(String columnName)Get the value of the column nameObject[]getValues()Get the row valuesStringgetValueString(int index)Get the value at the index as a stringStringgetValueString(String columnName)Get the value of the column name as a stringbooleanhasColumn(String columnName)Check if the row has the columnbooleanhasId()Check if the row has an id valuebooleanhasIdColumn()Check if the row has an id columnvoidresetId()Clears the id so the row can be used as part of an insert or createvoidsetId(long id)Set the idvoidsetValue(int index, Object value)Set the column value at the indexvoidsetValue(String columnName, Object value)Set the column value of the column nameprotected voidvalidateValue(TColumn column, Object value, Class<?>... valueTypes)Validate the value and its actual value types against the column data type class
-
-
-
Field Detail
-
columns
protected final UserColumns<TColumn extends UserColumn> columns
User columns
-
columnTypes
protected final int[] columnTypes
Cursor column types of this row, based upon the data values
-
values
protected final Object[] values
Array of row values
-
-
Constructor Detail
-
UserCoreRow
protected UserCoreRow(TTable table, UserColumns<TColumn> columns, int[] columnTypes, Object[] values)
Constructor- Parameters:
table- tablecolumns- columnscolumnTypes- column typesvalues- values- Since:
- 3.5.0
-
UserCoreRow
protected UserCoreRow(TTable table)
Constructor to create an empty row- Parameters:
table- table
-
UserCoreRow
protected UserCoreRow(UserCoreRow<TColumn,TTable> userCoreRow)
Copy Constructor- Parameters:
userCoreRow- user core row to copy
-
-
Method Detail
-
copyValue
protected Object copyValue(TColumn column, Object value)
Copy the value of the data type- Parameters:
column- table columnvalue- value- Returns:
- copy value
-
columnCount
public int columnCount()
Get the column count- Returns:
- column count
-
getAsMap
public Set<Map.Entry<String,ColumnValue>> getAsMap()
Get a Map- Returns:
- a map
- Since:
- 3.0.1
-
getColumnNames
public String[] getColumnNames()
Get the column names- Returns:
- column names
-
getColumnName
public String getColumnName(int index)
Get the column name at the index- Parameters:
index- index- Returns:
- column name
-
getColumnIndex
public int getColumnIndex(String columnName)
Get the index of the column name- Parameters:
columnName- column name- Returns:
- column index
-
getValue
public Object getValue(int index)
Get the value at the index- Parameters:
index- index- Returns:
- value
-
getValue
public Object getValue(String columnName)
Get the value of the column name- Parameters:
columnName- column name- Returns:
- value
-
getValueString
public String getValueString(int index)
Get the value at the index as a string- Parameters:
index- index- Returns:
- value
- Since:
- 3.2.0
-
getValueString
public String getValueString(String columnName)
Get the value of the column name as a string- Parameters:
columnName- column name- Returns:
- value
- Since:
- 3.2.0
-
getValues
public Object[] getValues()
Get the row values- Returns:
- values
-
getRowColumnTypes
public int[] getRowColumnTypes()
Get the row column data types- Returns:
- row column types
-
getRowColumnType
public int getRowColumnType(int index)
Get the Cursor column data type at the index- Parameters:
index- index- Returns:
- row column type
-
getRowColumnType
public int getRowColumnType(String columnName)
Get the Cursor column data type of the column name- Parameters:
columnName- column name- Returns:
- row column type
-
getTable
public TTable getTable()
Get the table- Returns:
- table
-
getColumns
public UserColumns<TColumn> getColumns()
Get the columns- Returns:
- columns
- Since:
- 3.5.0
-
getColumn
public TColumn getColumn(int index)
Get the column at the index- Parameters:
index- index- Returns:
- column
-
getColumn
public TColumn getColumn(String columnName)
Get the column of the column name- Parameters:
columnName- column name- Returns:
- column
-
hasColumn
public boolean hasColumn(String columnName)
Check if the row has the column- Parameters:
columnName- column name- Returns:
- true if has the column
- Since:
- 3.0.1
-
getId
public long getId()
Get the id value, which is the value of the primary key- Returns:
- id
-
hasIdColumn
public boolean hasIdColumn()
Check if the row has an id column- Returns:
- true if has an id column
- Since:
- 3.0.1
-
hasId
public boolean hasId()
Check if the row has an id value- Returns:
- true if has an id
- Since:
- 2.0.0
-
getPkColumnIndex
public int getPkColumnIndex()
Get the primary key column index- Returns:
- primary key column index
-
getPkColumn
public TColumn getPkColumn()
Get the primary key column- Returns:
- primary key column
-
setValue
public void setValue(int index, Object value)Set the column value at the index- Parameters:
index- indexvalue- value
-
setValue
public void setValue(String columnName, Object value)
Set the column value of the column name- Parameters:
columnName- column namevalue- value
-
setId
public void setId(long id)
Set the id- Parameters:
id- id value- Since:
- 4.0.0
-
resetId
public void resetId()
Clears the id so the row can be used as part of an insert or create
-
-