FileDocCategorySizeDatePackage
CrossProcessCursorWrapper.javaAPI DocAndroid 5.1 API2614Thu Mar 12 22:22:10 GMT 2015android.database

CrossProcessCursorWrapper

public class CrossProcessCursorWrapper extends android.database.CursorWrapper implements android.database.CrossProcessCursor
Cursor wrapper that implements {@link CrossProcessCursor}.

If the wrapped cursor implements {@link CrossProcessCursor}, then the wrapper delegates {@link #fillWindow}, {@link #getWindow()} and {@link #onMove} to it. Otherwise, the wrapper provides default implementations of these methods that traverse the contents of the cursor similar to {@link AbstractCursor#fillWindow}.

This wrapper can be used to adapt an ordinary {@link Cursor} into a {@link CrossProcessCursor}.

Fields Summary
Constructors Summary
public CrossProcessCursorWrapper(android.database.Cursor cursor)
Creates a cross process cursor wrapper.

param
cursor The underlying cursor to wrap.

        super(cursor);
    
Methods Summary
public voidfillWindow(int position, android.database.CursorWindow window)

        if (mCursor instanceof CrossProcessCursor) {
            final CrossProcessCursor crossProcessCursor = (CrossProcessCursor)mCursor;
            crossProcessCursor.fillWindow(position, window);
            return;
        }

        DatabaseUtils.cursorFillWindow(mCursor, position, window);
    
public android.database.CursorWindowgetWindow()

        if (mCursor instanceof CrossProcessCursor) {
            final CrossProcessCursor crossProcessCursor = (CrossProcessCursor)mCursor;
            return crossProcessCursor.getWindow();
        }

        return null;
    
public booleanonMove(int oldPosition, int newPosition)

        if (mCursor instanceof CrossProcessCursor) {
            final CrossProcessCursor crossProcessCursor = (CrossProcessCursor)mCursor;
            return crossProcessCursor.onMove(oldPosition, newPosition);
        }

        return true;