Package 

Class AbstractWindowedCursor

  • All Implemented Interfaces:
    android.database.Cursor , java.io.Closeable , java.lang.AutoCloseable

    
    public abstract class AbstractWindowedCursor
    extends AbstractCursor
                        

    A base class for Cursors that store their data in android.database.CursorWindows.

    The cursor owns the cursor window it uses. When the cursor is closed, its window is also closed. Likewise, when the window used by the cursor is changed, its old window is closed. This policy of strict ownership ensures that cursor windows are not leaked.

    Subclasses are responsible for filling the cursor window with data during onMove, allocating a new cursor window if necessary. During requery, the existing cursor window should be cleared and filled with new data.

    If the contents of the cursor change or become invalid, the old window must be closed (because it is owned by the cursor) and set to null.

    • Method Summary

      Modifier and Type Method Description
      Array<byte> getBlob(int columnIndex)
      String getString(int columnIndex)
      void copyStringToBuffer(int columnIndex, CharArrayBuffer buffer)
      short getShort(int columnIndex)
      int getInt(int columnIndex)
      long getLong(int columnIndex)
      float getFloat(int columnIndex)
      double getDouble(int columnIndex)
      boolean isNull(int columnIndex)
      int getType(int columnIndex)
      CursorWindow getWindow()
      void setWindow(CursorWindow window) Sets a new cursor window for the cursor to use.
      boolean hasWindow() Returns true if the cursor has an associated cursor window.
      • Methods inherited from class net.zetetic.database.AbstractCursor

        close, deactivate, fillWindow, getBlob, getColumnCount, getColumnIndex, getColumnIndexOrThrow, getColumnName, getColumnNames, getCount, getDouble, getExtras, getFloat, getInt, getLong, getNotificationUri, getPosition, getShort, getString, getType, getWantsAllOnMoveCalls, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, isNull, move, moveToFirst, moveToLast, moveToNext, moveToPosition, moveToPrevious, onMove, registerContentObserver, registerDataSetObserver, requery, respond, setExtras, setNotificationUri, unregisterContentObserver, unregisterDataSetObserver
      • 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

      • getShort

         short getShort(int columnIndex)
      • getInt

         int getInt(int columnIndex)
      • getLong

         long getLong(int columnIndex)
      • getFloat

         float getFloat(int columnIndex)
      • getDouble

         double getDouble(int columnIndex)
      • isNull

         boolean isNull(int columnIndex)
      • getType

         int getType(int columnIndex)
      • setWindow

         void setWindow(CursorWindow window)

        Sets a new cursor window for the cursor to use.

        The cursor takes ownership of the provided cursor window; the cursor windowwill be closed when the cursor is closed or when the cursor adopts a newcursor window.

        If the cursor previously had a cursor window, then it is closed when thenew cursor window is assigned.

        Parameters:
        window - The new cursor window, typically a remote cursor window.
      • hasWindow

         boolean hasWindow()

        Returns true if the cursor has an associated cursor window.