Package mil.nga.geopackage.user
Class UserCursor<TColumn extends UserColumn,TTable extends UserTable<TColumn>,TRow extends UserRow<TColumn,TTable>>
java.lang.Object
android.database.CursorWrapper
mil.nga.geopackage.db.CursorResult
mil.nga.geopackage.user.UserCursor<TColumn,TTable,TRow>
- Type Parameters:
TColumn
- column typeTTable
- table typeTRow
- row type
- All Implemented Interfaces:
Cursor
,Closeable
,AutoCloseable
,Iterable<TRow>
,Result
,UserCoreResult<TColumn,
TTable, TRow>
- Direct Known Subclasses:
AttributesCursor
,FeatureCursor
,TileCursor
,UserCustomCursor
public abstract class UserCursor<TColumn extends UserColumn,TTable extends UserTable<TColumn>,TRow extends UserRow<TColumn,TTable>>
extends CursorResult
implements UserCoreResult<TColumn,TTable,TRow>
Abstract User Cursor
-
Field Summary
Fields inherited from interface android.database.Cursor
FIELD_TYPE_BLOB, FIELD_TYPE_FLOAT, FIELD_TYPE_INTEGER, FIELD_TYPE_NULL, FIELD_TYPE_STRING
-
Constructor Summary
ModifierConstructorDescriptionprotected
UserCursor
(TTable table, Cursor cursor) Constructorprotected
UserCursor
(TTable table, String[] columns, Cursor cursor) Constructorprotected
UserCursor
(TTable table, UserColumns<TColumn> columns, Cursor cursor) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected abstract UserInvalidCursor<TColumn,
TTable, TRow, ? extends UserCursor<TColumn, TTable, TRow>, ? extends UserDao<TColumn, TTable, TRow, ? extends UserCursor<TColumn, TTable, TRow>>> createInvalidCursor
(UserDao dao, UserCursor cursor, List<Integer> invalidPositions, List<TColumn> blobColumns) Create an invalid cursorprotected void
enableInvalidRequery
(UserDao<TColumn, TTable, TRow, ? extends UserCursor<TColumn, TTable, TRow>> dao) Enable requery attempt of invalid rows after iterating through original query rows.int
getCount()
long
getId()
Get the invalid positions found when retrieving rowsgetQuery()
Get the user querygetRow()
String[]
getSql()
getTable()
getValue
(int index) getValue
(int index, GeoPackageDataType dataType) boolean
Determine if invalid positions were found when retrieving rows or if all are invalid (null)ids()
boolean
Get the cursor SQLite connection origination as bindings or standarditerator()
boolean
static void
readBlobValue
(UserDao dao, UserCoreResult result, UserRow row, UserColumn column) Read the blob column value in chunksvoid
setColumns
(UserColumns<TColumn> columns) Set the columnsvoid
Set the user queryvoid
Set the tablevoid
setUseBindings
(boolean useBindings) Set the cursor SQLite connection origination as bindings or standardMethods inherited from class mil.nga.geopackage.db.CursorResult
wasNull
Methods inherited from class android.database.CursorWrapper
copyStringToBuffer, deactivate, getBlob, getColumnCount, getColumnIndex, getColumnIndexOrThrow, getColumnName, getColumnNames, getDouble, getExtras, getFloat, getInt, getLong, getNotificationUri, getNotificationUris, getPosition, getShort, getString, getType, getWantsAllOnMoveCalls, getWrappedCursor, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isNull, move, moveToFirst, moveToLast, moveToPosition, moveToPrevious, registerContentObserver, registerDataSetObserver, requery, respond, setExtras, setNotificationUri, setNotificationUris, unregisterContentObserver, unregisterDataSetObserver
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface mil.nga.geopackage.db.Result
getBlob, getColumnCount, getColumnIndex, getDouble, getFloat, getInt, getLong, getPosition, getShort, getString, getType, moveToFirst, moveToPosition, wasNull
Methods inherited from interface mil.nga.geopackage.user.UserCoreResult
getRow
-
Constructor Details
-
UserCursor
Constructor- Parameters:
table
- tablecursor
- cursor
-
UserCursor
Constructor- Parameters:
table
- tablecolumns
- columnscursor
- cursor- Since:
- 3.5.0
-
UserCursor
Constructor- Parameters:
table
- tablecolumns
- columnscursor
- cursor- Since:
- 3.5.0
-
-
Method Details
-
getValue
-
getValue
- Specified by:
getValue
in interfaceResult
- Specified by:
getValue
in interfaceUserCoreResult<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>> - Overrides:
getValue
in classCursorResult
-
getValue
-
getId
public long getId() -
setTable
Set the table- Parameters:
table
- table- Since:
- 3.2.0
-
getTable
-
getTableName
- Specified by:
getTableName
in interfaceUserCoreResult<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>>
-
setColumns
Set the columns- Parameters:
columns
- columns- Since:
- 3.5.0
-
getColumns
- Specified by:
getColumns
in interfaceUserCoreResult<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>>
-
getInvalidPositions
Get the invalid positions found when retrieving rows- Returns:
- invalid positions, empty if none, null if all invalid
- Since:
- 2.0.0
-
hasInvalidPositions
public boolean hasInvalidPositions()Determine if invalid positions were found when retrieving rows or if all are invalid (null)- Returns:
- true if invalid positions
- Since:
- 2.0.0
-
getCount
public int getCount()- Specified by:
getCount
in interfaceCursor
- Specified by:
getCount
in interfaceUserCoreResult<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>> - Overrides:
getCount
in classCursorWrapper
-
moveToNext
public boolean moveToNext()- Specified by:
moveToNext
in interfaceCursor
- Specified by:
moveToNext
in interfaceResult
- Overrides:
moveToNext
in classCursorWrapper
-
getRow
-
getValue
- Specified by:
getValue
in interfaceResult
- Overrides:
getValue
in classCursorResult
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceCursor
- Specified by:
close
in interfaceResult
- Overrides:
close
in classCursorWrapper
-
setQuery
Set the user query- Parameters:
query
- user query- Since:
- 2.0.0
-
getQuery
Get the user query- Returns:
- user query
- Since:
- 2.0.0
-
setUseBindings
public void setUseBindings(boolean useBindings) Set the cursor SQLite connection origination as bindings or standard- Parameters:
useBindings
- true if bindings connection, false if standard- Since:
- 6.2.1
-
isUseBindings
public boolean isUseBindings()Get the cursor SQLite connection origination as bindings or standard- Returns:
- true if bindings connection, false if standard
- Since:
- 6.2.1
-
enableInvalidRequery
protected void enableInvalidRequery(UserDao<TColumn, TTable, TRow, ? extends UserCursor<TColumn, TTable, TRow>> dao) Enable requery attempt of invalid rows after iterating through original query rows. Only supported formoveToNext()
andgetRow()
usage.- Parameters:
dao
- data access object used to perform requery- Since:
- 2.0.0
-
createInvalidCursor
protected abstract UserInvalidCursor<TColumn,TTable, createInvalidCursorTRow, ? extends UserCursor<TColumn, TTable, TRow>, ? extends UserDao<TColumn, TTable, TRow, ? extends UserCursor<TColumn, TTable, TRow>>> (UserDao dao, UserCursor cursor, List<Integer> invalidPositions, List<TColumn> blobColumns) Create an invalid cursor- Parameters:
dao
- data access objectcursor
- user cursorinvalidPositions
- invalid positionsblobColumns
- blob columns- Returns:
- invalid cursor
-
readBlobValue
public static void readBlobValue(UserDao dao, UserCoreResult result, UserRow row, UserColumn column) Read the blob column value in chunks- Parameters:
dao
- user daoresult
- user core resultrow
- user rowcolumn
- user blob column
-
iterator
- Specified by:
iterator
in interfaceIterable<TColumn extends UserColumn>
-
getSql
-
getSelectionArgs
- Specified by:
getSelectionArgs
in interfaceUserCoreResult<TColumn extends UserColumn,
TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>>
-
ids
-