CursorObjectAdapter
class CursorObjectAdapter : ObjectAdapter
An ObjectAdapter implemented with a Cursor.
Summary
Public constructors |
|---|
|
Constructs an adapter. |
CursorObjectAdapter(presenter: Presenter!)Constructs an adapter that uses the given |
CursorObjectAdapter(presenterSelector: PresenterSelector!)Constructs an adapter with the given |
Public functions |
|
|---|---|
Unit |
changeCursor(cursor: Cursor!)Changes the underlying cursor to a new cursor. |
Unit |
close()Closes this adapter, closing the backing |
Any? |
Returns the item for the given position. |
Cursor! |
Returns the |
CursorMapper! |
Returns the |
Boolean |
isClosed()Returns true if the adapter, and hence the backing |
Boolean |
Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise. |
Unit |
setMapper(mapper: CursorMapper!)Sets the |
Int |
size()Returns the number of items in the adapter. |
Cursor! |
swapCursor(cursor: Cursor!)Swap in a new Cursor, returning the old Cursor. |
Protected functions |
|
|---|---|
Unit |
invalidateCache(index: Int)Removes an item from the cache. |
Unit |
invalidateCache(index: Int, count: Int)Removes |
Unit |
Called whenever the cursor changes. |
Unit |
Called when |
Inherited functions |
||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
CursorObjectAdapter
CursorObjectAdapter(presenter: Presenter!)
Constructs an adapter that uses the given Presenter for all items.
CursorObjectAdapter
CursorObjectAdapter(presenterSelector: PresenterSelector!)
Constructs an adapter with the given PresenterSelector.
Public functions
changeCursor
fun changeCursor(cursor: Cursor!): Unit
Changes the underlying cursor to a new cursor. If there is an existing cursor it will be closed if it is different than the new cursor.
| Parameters | |
|---|---|
cursor: Cursor! |
The new cursor to be used. |
getMapper
fun getMapper(): CursorMapper!
Returns the CursorMapper used to convert Cursor rows into Objects.
isClosed
fun isClosed(): Boolean
Returns true if the adapter, and hence the backing Cursor, is closed; false otherwise.
isImmediateNotifySupported
fun isImmediateNotifySupported(): Boolean
Returns true if the adapter pairs each underlying data change with a call to notify and false otherwise.
setMapper
fun setMapper(mapper: CursorMapper!): Unit
Sets the CursorMapper used to convert Cursor rows into Objects.
swapCursor
fun swapCursor(cursor: Cursor!): Cursor!
Swap in a new Cursor, returning the old Cursor. Unlike changeCursor(Cursor), the returned old Cursor is not closed.
| Parameters | |
|---|---|
cursor: Cursor! |
The new cursor to be used. |
Protected functions
invalidateCache
protected fun invalidateCache(index: Int): Unit
Removes an item from the cache. This will force the item to be re-read from the data source the next time get is called.
invalidateCache
protected fun invalidateCache(index: Int, count: Int): Unit
Removes count items starting at index.
onCursorChanged
protected fun onCursorChanged(): Unit
Called whenever the cursor changes.
onMapperChanged
protected fun onMapperChanged(): Unit
Called when setMapper is called and a different mapper is provided.