-
- All Implemented Interfaces:
-
android.database.Cursor,java.io.Closeable,java.lang.AutoCloseable
public abstract class AbstractCursor implements Cursor
This is an abstract cursor class that handles a lot of the common code that all cursors need to deal with and is provided for convenience reasons.
-
-
Constructor Summary
Constructors Constructor Description AbstractCursor()
-
Method Summary
Modifier and Type Method Description voidfillWindow(int position, CursorWindow window)abstract intgetCount()abstract Array<String>getColumnNames()abstract StringgetString(int column)abstract shortgetShort(int column)abstract intgetInt(int column)abstract longgetLong(int column)abstract floatgetFloat(int column)abstract doublegetDouble(int column)abstract booleanisNull(int column)abstract intgetType(int column)Array<byte>getBlob(int column)intgetColumnCount()voiddeactivate()booleanrequery()booleanisClosed()voidclose()voidcopyStringToBuffer(int columnIndex, CharArrayBuffer buffer)final intgetPosition()final booleanmoveToPosition(int position)abstract booleanonMove(int oldPosition, int newPosition)This function is called every time the cursor is successfully scrolledto a new position, giving the subclass a chance to update any state itmay have. final booleanmove(int offset)final booleanmoveToFirst()final booleanmoveToLast()final booleanmoveToNext()final booleanmoveToPrevious()final booleanisFirst()final booleanisLast()final booleanisBeforeFirst()final booleanisAfterLast()intgetColumnIndex(String columnName)intgetColumnIndexOrThrow(String columnName)StringgetColumnName(int columnIndex)voidregisterContentObserver(ContentObserver observer)voidunregisterContentObserver(ContentObserver observer)voidregisterDataSetObserver(DataSetObserver observer)voidunregisterDataSetObserver(DataSetObserver observer)voidsetNotificationUri(ContentResolver cr, Uri notifyUri)Specifies a content URI to watch for changes. UrigetNotificationUri()booleangetWantsAllOnMoveCalls()voidsetExtras(Bundle extras)BundlegetExtras()Bundlerespond(Bundle extras)-
Methods inherited from class android.database.Cursor
close, copyStringToBuffer, deactivate, getBlob, getColumnCount, getColumnIndex, getColumnIndexOrThrow, getColumnName, getColumnNames, getCount, getDouble, getExtras, getFloat, getInt, getLong, getNotificationUri, getNotificationUris, getPosition, getShort, getString, getType, getWantsAllOnMoveCalls, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isNull, move, moveToFirst, moveToLast, moveToNext, 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
-
-
Method Detail
-
fillWindow
void fillWindow(int position, CursorWindow window)
-
getCount
abstract int getCount()
-
getColumnNames
abstract Array<String> getColumnNames()
-
getShort
abstract short getShort(int column)
-
getInt
abstract int getInt(int column)
-
getLong
abstract long getLong(int column)
-
getFloat
abstract float getFloat(int column)
-
getDouble
abstract double getDouble(int column)
-
isNull
abstract boolean isNull(int column)
-
getType
abstract int getType(int column)
-
getColumnCount
int getColumnCount()
-
deactivate
void deactivate()
-
requery
boolean requery()
-
isClosed
boolean isClosed()
-
close
void close()
-
copyStringToBuffer
void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer)
-
getPosition
final int getPosition()
-
moveToPosition
final boolean moveToPosition(int position)
-
onMove
abstract boolean onMove(int oldPosition, int newPosition)
This function is called every time the cursor is successfully scrolledto a new position, giving the subclass a chance to update any state itmay have. If it returns false the move function will also do so and thecursor will scroll to the beforeFirst position.
This function should be called by methods such as moveToPosition,so it will typically not be called from outside of the cursor class itself.
- Parameters:
oldPosition- The position that we're moving from.newPosition- The position that we're moving to.
-
move
final boolean move(int offset)
-
moveToFirst
final boolean moveToFirst()
-
moveToLast
final boolean moveToLast()
-
moveToNext
final boolean moveToNext()
-
moveToPrevious
final boolean moveToPrevious()
-
isFirst
final boolean isFirst()
-
isLast
final boolean isLast()
-
isBeforeFirst
final boolean isBeforeFirst()
-
isAfterLast
final boolean isAfterLast()
-
getColumnIndex
int getColumnIndex(String columnName)
-
getColumnIndexOrThrow
int getColumnIndexOrThrow(String columnName)
-
getColumnName
String getColumnName(int columnIndex)
-
registerContentObserver
void registerContentObserver(ContentObserver observer)
-
unregisterContentObserver
void unregisterContentObserver(ContentObserver observer)
-
registerDataSetObserver
void registerDataSetObserver(DataSetObserver observer)
-
unregisterDataSetObserver
void unregisterDataSetObserver(DataSetObserver observer)
-
setNotificationUri
void setNotificationUri(ContentResolver cr, Uri notifyUri)
Specifies a content URI to watch for changes.
- Parameters:
cr- The content resolver from the caller's context.notifyUri- The URI to watch for changes.
-
getNotificationUri
Uri getNotificationUri()
-
getWantsAllOnMoveCalls
boolean getWantsAllOnMoveCalls()
-
-
-
-