FileDocCategorySizeDatePackage
CrossProcessCursor.javaAPI DocAndroid 5.1 API3299Thu Mar 12 22:22:10 GMT 2015android.database

CrossProcessCursor

public interface CrossProcessCursor implements Cursor
A cross process cursor is an extension of a {@link Cursor} that also supports usage from remote processes.

The contents of a cross process cursor are marshalled to the remote process by filling {@link CursorWindow} objects using {@link #fillWindow}. As an optimization, the cursor can provide a pre-filled window to use via {@link #getWindow} thereby obviating the need to copy the data to yet another cursor window.

Fields Summary
Constructors Summary
Methods Summary
public voidfillWindow(int position, CursorWindow window)
Copies cursor data into the window.

Clears the window and fills it with data beginning at the requested row position until all of the data in the cursor is exhausted or the window runs out of space.

The filled window uses the same row indices as the original cursor. For example, if you fill a window starting from row 5 from the cursor, you can query the contents of row 5 from the window just by asking it for row 5 because there is a direct correspondence between the row indices used by the cursor and the window.

The current position of the cursor, as returned by {@link #getPosition}, is not changed by this method.

param
position The zero-based index of the first row to copy into the window.
param
window The window to fill.

public CursorWindowgetWindow()
Returns a pre-filled window that contains the data within this cursor.

In particular, the window contains the row indicated by {@link Cursor#getPosition}. The window's contents are automatically scrolled whenever the current row moved outside the range covered by the window.

return
The pre-filled window, or null if none.

public booleanonMove(int oldPosition, int newPosition)
This function is called every time the cursor is successfully scrolled to a new position, giving the subclass a chance to update any state it may have. If it returns false the move function will also do so and the cursor will scroll to the beforeFirst position.

This function should be called by methods such as {@link #moveToPosition(int)}, so it will typically not be called from outside of the cursor class itself.

param
oldPosition The position that we're moving from.
param
newPosition The position that we're moving to.
return
True if the move is successful, false otherwise.