Stay organized with collections
    
    
      
      Save and categorize content based on your preferences.
    
  
  
    
  
  
  
  
    
  
  
    
    
    
    CursorWrapper
    open class CursorWrapper : Cursor
    
    
    Wrapper class for Cursor that delegates all calls to the actual cursor object. The primary use for this class is to extend a cursor while overriding only a subset of its methods.
    Summary
    
    
      
        
          | Public constructors | 
        
          | Creates a cursor wrapper. | 
      
    
    
    Public constructors
    
      CursorWrapper
      
      CursorWrapper(cursor: Cursor!)
      Creates a cursor wrapper.
      
        
          
            | Parameters | 
          
            | cursor | Cursor!: The underlying cursor to wrap. | 
        
      
     
    Public methods
    
      close
      
      open fun close(): Unit
      
        
          
            | Exceptions | 
          
            | java.lang.Exception | if this resource cannot be closed | 
          
            | java.io.IOException | if an I/O error occurs | 
        
      
     
    
      copyStringToBuffer
      
      open fun copyStringToBuffer(
    columnIndex: Int, 
    buffer: CharArrayBuffer!
): Unit
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. if the target column is null, return buffer Value is 0 or greater | 
          
            | buffer | CharArrayBuffer!: the buffer to copy the text into. | 
        
      
     
    
      deactivate
      
      open fun deactivate(): Unit
      Deprecated: Deprecated in Java. 
     
    
      getBlob
      
      open fun getBlob(columnIndex: Int): ByteArray!
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | ByteArray! | the value of that column as a byte array. | 
        
      
     
    
      getColumnCount
      
      open fun getColumnCount(): Int
      
        
          
            | Return | 
          
            | Int | number of columns Value is 0 or greater | 
        
      
     
    
      getColumnIndex
      
      open fun getColumnIndex(columnName: String!): Int
      
        
          
            | Parameters | 
          
            | columnName | String!: the name of the target column. | 
        
      
      
        
          
            | Return | 
          
            | Int | the zero-based column index for the given column name, or -1 if the column name does not exist. Value is -1 or greater | 
        
      
     
    
      getColumnIndexOrThrow
      
      open fun getColumnIndexOrThrow(columnName: String!): Int
      
        
          
            | Parameters | 
          
            | columnName | String!: the name of the target column. | 
        
      
      
        
          
            | Return | 
          
            | Int | the zero-based column index for the given column name Value is 0 or greater | 
        
      
      
        
          
            | Exceptions | 
          
            | java.lang.IllegalArgumentException | if the column does not exist | 
        
      
     
    
      getColumnName
      
      open fun getColumnName(columnIndex: Int): String!
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | String! | the column name for the given column index. | 
        
      
     
    
      getColumnNames
      
      open fun getColumnNames(): Array<String!>!
      
        
          
            | Return | 
          
            | Array<String!>! | the names of the columns returned in this query. | 
        
      
     
    
      getCount
      
      open fun getCount(): Int
      
        
          
            | Return | 
          
            | Int | the number of rows in the cursor. Value is 0 or greater | 
        
      
     
    
      getDouble
      
      open fun getDouble(columnIndex: Int): Double
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | Double | the value of that column as a double. | 
        
      
     
    
    
      getFloat
      
      open fun getFloat(columnIndex: Int): Float
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | Float | the value of that column as a float. | 
        
      
     
    
      getInt
      
      open fun getInt(columnIndex: Int): Int
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | Int | the value of that column as an int. | 
        
      
     
    
      getLong
      
      open fun getLong(columnIndex: Int): Long
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | Long | the value of that column as a long. | 
        
      
     
    
      getNotificationUri
      
      open fun getNotificationUri(): Uri!
      
     
    
      getNotificationUris
      
      open fun getNotificationUris(): MutableList<Uri!>?
      
     
    
      getPosition
      
      open fun getPosition(): Int
      
        
          
            | Return | 
          
            | Int | the current cursor position. Value is -1 or greater | 
        
      
     
    
      getShort
      
      open fun getShort(columnIndex: Int): Short
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | Short | the value of that column as a short. | 
        
      
     
    
      getString
      
      open fun getString(columnIndex: Int): String!
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | String! | the value of that column as a String. | 
        
      
     
    
      getType
      
      open fun getType(columnIndex: Int): Int
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
     
    
      getWantsAllOnMoveCalls
      
      open fun getWantsAllOnMoveCalls(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether all cursor movement should result in a call to onMove(). | 
        
      
     
    
      getWrappedCursor
      
      open fun getWrappedCursor(): Cursor!
      Gets the underlying cursor that is wrapped by this instance.
      
        
          
            | Return | 
          
            | Cursor! | The wrapped cursor. | 
        
      
     
    
      isAfterLast
      
      open fun isAfterLast(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the cursor is after the last result. | 
        
      
     
    
      isBeforeFirst
      
      open fun isBeforeFirst(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the cursor is before the first result. | 
        
      
     
    
      isClosed
      
      open fun isClosed(): Boolean
      
        
          
            | Return | 
          
            | Boolean | true if the cursor is closed. | 
        
      
     
    
      isFirst
      
      open fun isFirst(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the cursor is pointing at the first entry. | 
        
      
     
    
      isLast
      
      open fun isLast(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the cursor is pointing at the last entry. | 
        
      
     
    
      isNull
      
      open fun isNull(columnIndex: Int): Boolean
      
        
          
            | Parameters | 
          
            | columnIndex | Int: the zero-based index of the target column. Value is 0 or greater | 
        
      
      
        
          
            | Return | 
          
            | Boolean | whether the column value is null. | 
        
      
     
    
      move
      
      open fun move(offset: Int): Boolean
      
        
          
            | Parameters | 
          
            | offset | Int: the offset to be applied from the current position. | 
        
      
      
        
          
            | Return | 
          
            | Boolean | whether the requested move fully succeeded. | 
        
      
     
    
      moveToFirst
      
      open fun moveToFirst(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the move succeeded. | 
        
      
     
    
      moveToLast
      
      open fun moveToLast(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the move succeeded. | 
        
      
     
    
      moveToNext
      
      open fun moveToNext(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the move succeeded. | 
        
      
     
    
      moveToPosition
      
      open fun moveToPosition(position: Int): Boolean
      
        
          
            | Parameters | 
          
            | position | Int: the zero-based position to move to. Value is -1 or greater | 
        
      
      
        
          
            | Return | 
          
            | Boolean | whether the requested move fully succeeded. | 
        
      
     
    
      moveToPrevious
      
      open fun moveToPrevious(): Boolean
      
        
          
            | Return | 
          
            | Boolean | whether the move succeeded. | 
        
      
     
    
      registerContentObserver
      
      open fun registerContentObserver(observer: ContentObserver!): Unit
      
        
          
            | Parameters | 
          
            | observer | ContentObserver!: the object that gets notified when the content backing the cursor changes. | 
        
      
     
    
      registerDataSetObserver
      
      open fun registerDataSetObserver(observer: DataSetObserver!): Unit
      
        
          
            | Parameters | 
          
            | observer | DataSetObserver!: the object that gets notified when the cursors data set changes. | 
        
      
     
    
      requery
      
      open fun requery(): Boolean
      Deprecated: Deprecated in Java. 
      
        
          
            | Return | 
          
            | Boolean | true if the requery succeeded, false if not, in which case the cursor becomes invalid. | 
        
      
     
    
    
      
      
      open fun setExtras(extras: Bundle!): Unit
      
        
          
            | Parameters | 
          
            | extras | Bundle!: Bundleto set, or null to set an empty bundle. | 
        
      
     
    
      setNotificationUri
      
      open fun setNotificationUri(
    cr: ContentResolver!, 
    uri: Uri!
): Unit
      
        
          
            | Parameters | 
          
            | cr | ContentResolver!: The content resolver from the caller's context. The listener attached to this resolver will be notified. | 
          
            | uri | Uri!: The content URI to watch. | 
        
      
     
    
      setNotificationUris
      
      open fun setNotificationUris(
    cr: ContentResolver, 
    uris: MutableList<Uri!>
): Unit
      
        
          
            | Parameters | 
          
            | cr | ContentResolver: The content resolver from the caller's context. The listener attached to this resolver will be notified. This value cannot be null. | 
          
            | uris | MutableList<Uri!>: The content URIs to watch. This value cannot be null. | 
        
      
     
    
    
  
  
  
    
  
 
  
    
    
      
       
    
    
  
  
  Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
  Last updated 2025-02-10 UTC.
  
  
  
    
      [null,null,["Last updated 2025-02-10 UTC."],[],[]]