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:
android.database.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
ConstructorsModifierConstructorDescriptionprotectedUserCursor(TTable table, android.database.Cursor cursor) ConstructorprotectedUserCursor(TTable table, String[] columns, android.database.Cursor cursor) ConstructorprotectedUserCursor(TTable table, UserColumns<TColumn> columns, android.database.Cursor cursor) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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 voidenableInvalidRequery(UserDao<TColumn, TTable, TRow, ? extends UserCursor<TColumn, TTable, TRow>> dao) Enable requery attempt of invalid rows after iterating through original query rows.intgetCount()longgetId()Get the invalid positions found when retrieving rowsgetQuery()Get the user querygetRow()String[]getSql()getTable()getValue(int index) getValue(int index, GeoPackageDataType dataType) booleanDetermine if invalid positions were found when retrieving rows or if all are invalid (null)ids()booleanGet the cursor SQLite connection origination as bindings or standarditerator()booleanstatic voidreadBlobValue(UserDao dao, UserCoreResult result, UserRow row, UserColumn column) Read the blob column value in chunksvoidsetColumns(UserColumns<TColumn> columns) Set the columnsvoidSet the user queryvoidSet the tablevoidsetUseBindings(boolean useBindings) Set the cursor SQLite connection origination as bindings or standardMethods inherited from class mil.nga.geopackage.db.CursorResult
wasNullMethods 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, unregisterDataSetObserverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface mil.nga.geopackage.db.Result
getBlob, getColumnCount, getColumnIndex, getDouble, getFloat, getInt, getLong, getPosition, getShort, getString, getType, moveToFirst, moveToPosition, wasNullMethods 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:
getValuein interfaceResult- Specified by:
getValuein interfaceUserCoreResult<TColumn extends UserColumn,TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>> - Overrides:
getValuein classCursorResult
-
getValue
-
getId
public long getId() -
setTable
Set the table- Parameters:
table- table- Since:
- 3.2.0
-
getTable
-
getTableName
- Specified by:
getTableNamein 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:
getColumnsin 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() -
moveToNext
public boolean moveToNext()- Specified by:
moveToNextin interfaceandroid.database.Cursor- Specified by:
moveToNextin interfaceResult- Overrides:
moveToNextin classandroid.database.CursorWrapper
-
getRow
-
getValue
- Specified by:
getValuein interfaceResult- Overrides:
getValuein classCursorResult
-
close
public void close() -
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:
iteratorin interfaceIterable<TColumn extends UserColumn>
-
getSql
-
getSelectionArgs
- Specified by:
getSelectionArgsin interfaceUserCoreResult<TColumn extends UserColumn,TTable extends UserTable<TColumn>, TRow extends UserRow<TColumn, TTable>>
-
ids
-