MergeCursor
open class MergeCursor : AbstractCursor
A convenience class that lets you present an array of Cursors as a single linear Cursor. The schema of the cursors presented is entirely up to the creator of the MergeCursor, and may be different if that is desired. Calls to getColumns, getColumnIndex, etc will return the value for the row that the MergeCursor is currently pointing at.
Summary
Inherited functions |
From class AbstractCursor
Unit |
checkPosition()
This function throws CursorIndexOutOfBoundsException if the cursor position is out of bounds. Subclass implementations of the get functions should call this before attempting to retrieve data.
|
Unit |
copyStringToBuffer(columnIndex: Int, buffer: CharArrayBuffer!)
|
Unit |
fillWindow(position: Int, window: CursorWindow!)
|
Unit |
finalize()
|
Int |
getColumnCount()
|
Int |
getColumnIndex(columnName: String!)
|
Int |
getColumnIndexOrThrow(columnName: String!)
|
String! |
getColumnName(columnIndex: Int)
|
Bundle! |
getExtras()
|
Uri! |
getNotificationUri()
|
MutableList<Uri!>? |
getNotificationUris()
|
Int |
getPosition()
|
Any! |
getUpdatedField(columnIndex: Int)
|
Boolean |
getWantsAllOnMoveCalls()
|
CursorWindow! |
getWindow()
If the cursor is backed by a CursorWindow , returns a pre-filled window with the contents of the cursor, otherwise null.
|
Boolean |
isAfterLast()
|
Boolean |
isBeforeFirst()
|
Boolean |
isClosed()
|
Boolean |
isFieldUpdated(columnIndex: Int)
|
Boolean |
isFirst()
|
Boolean |
isLast()
|
Boolean |
move(offset: Int)
|
Boolean |
moveToFirst()
|
Boolean |
moveToLast()
|
Boolean |
moveToNext()
|
Boolean |
moveToPosition(position: Int)
|
Boolean |
moveToPrevious()
|
Unit |
onChange(selfChange: Boolean)
Subclasses must call this method when they finish committing updates to notify all observers.
|
Bundle! |
respond(extras: Bundle!)
|
Unit |
setExtras(extras: Bundle!)
|
Unit |
setNotificationUri(cr: ContentResolver!, notifyUri: Uri!)
Specifies a content URI to watch for changes.
|
Unit |
setNotificationUris(cr: ContentResolver, notifyUris: MutableList<Uri!>)
Similar to setNotificationUri(android.content.ContentResolver,android.net.Uri) , except this version allows to watch multiple content URIs for changes.
If this is not implemented, this is equivalent to calling setNotificationUri(android.content.ContentResolver,android.net.Uri) with the first URI in uris .
Calling this overrides any previous call to setNotificationUri(android.content.ContentResolver,android.net.Uri) .
|
|
Public constructors
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 |
deactivate
open fun deactivate(): Unit
getBlob
open fun getBlob(column: Int): ByteArray!
Parameters |
columnIndex |
the zero-based index of the target column. Value is 0 or greater |
Return |
ByteArray! |
the value of that column as a byte array. |
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(column: Int): Double
Parameters |
columnIndex |
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(column: Int): Float
Parameters |
columnIndex |
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(column: Int): Int
Parameters |
columnIndex |
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(column: Int): Long
Parameters |
columnIndex |
the zero-based index of the target column. Value is 0 or greater |
Return |
Long |
the value of that column as a long. |
getShort
open fun getShort(column: Int): Short
Parameters |
columnIndex |
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(column: Int): String!
Parameters |
columnIndex |
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(column: Int): Int
Parameters |
columnIndex |
the zero-based index of the target column. Value is 0 or greater |
isNull
open fun isNull(column: Int): Boolean
Parameters |
columnIndex |
the zero-based index of the target column. Value is 0 or greater |
Return |
Boolean |
whether the column value is null. |
onMove
open fun onMove(
oldPosition: Int,
newPosition: Int
): Boolean
Parameters |
oldPosition |
Int: the position that we're moving from |
newPosition |
Int: the position that we're moving to |
Return |
Boolean |
true if the move is successful, false otherwise |
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
Return |
Boolean |
true if the requery succeeded, false if not, in which case the cursor becomes invalid. |
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 2024-04-04 UTC.