Reference:Android.database.MergeCursor

From Triled Wiki

Jump to: navigation, search


android.database
public class android.database.MergeCursor

java.lang.Object
android.database.AbstractCursor Cursor
android.database.MergeCursor

A convience 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.

Contents

[edit] Summary


[edit] Fields inherited from class android.database.AbstractCursor

mContentResolver, mCurrentRowID, mPos, mRowIdColumnIndex, mUpdatedRows

[edit] Public Constructors

          MergeCursor (Cursor[ ] cursors)

[edit] Public Methods

        int  count ()
Returns the numbers of rows in the cursor.
        void  deactivate ()
Deactivates the Cursor, making all calls on it fail until requery() is called.
        boolean  deleteRow ()
Removes the row at the current cursor position from the underlying data store.
        String[getColumnNames ()
Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result.
        double  getDouble (int column)
Returns the value of the requested column as a double.
        float  getFloat (int column)
Returns the value of the requested column as a float.
        int  getInt (int column)
Returns the value of the requested column as an int.
        long  getLong (int column)
Returns the value of the requested column as a long.
        short  getShort (int column)
Returns the value of the requested column as a short.
        String   getString (int column)
Returns the value of the requested column as a String.
        boolean  isNull (int column)
Returns true if the value in the indicated column is null.
        void  registerContentObserver (ContentObserver observer)
Register an observer that is called when changes happen to the content backing this cursor.
        boolean  requery ()
Performs the query that created the cursor again, refreshing its contents.
        void  unregisterContentObserver (ContentObserver observer)
Unregister an observer that has previously been registered with this cursor via registerContentObserver(ContentObserver).

[edit] Protected Methods

        boolean  onMove (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.

[edit] Methods inherited from class android.database.AbstractCursor
abortUpdates, checkPosition, close, >)">commitUpdates, commitUpdates, count, deactivate, deleteRow, finalize, first, getColumnIndex, getColumnName, getColumnNames, getDouble, getExtras, getFloat, getInt, getLong, getShort, getString, getUpdatedField, getWantsAllOnMoveCalls, hasUpdates, isAfterLast, isBeforeFirst, isFieldUpdated, isFirst, isLast, isNull, last, move, moveTo, next, onChange, onMove, position, prev, registerContentObserver, registerDataSetObserver, requery, respond, setNotificationUri, supportsUpdates, unregisterContentObserver, unregisterDataSetObserver, update, updateDouble, updateFloat, updateInt, updateLong, updateShort, updateString, updateToNull
[edit] Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
[edit] Methods inherited from interface android.database.Cursor

abortUpdates, close, >)">commitUpdates, commitUpdates, count, deactivate, deleteRow, first, getColumnIndex, getColumnName, getColumnNames, getDouble, getExtras, getFloat, getInt, getLong, getShort, getString, getWantsAllOnMoveCalls, hasUpdates, isAfterLast, isBeforeFirst, isFirst, isLast, isNull, last, move, moveTo, next, position, prev, registerContentObserver, registerDataSetObserver, requery, respond, setNotificationUri, supportsUpdates, unregisterContentObserver, unregisterDataSetObserver, updateDouble, updateFloat, updateInt, updateLong, updateShort, updateString, updateToNull

[edit] Details

[edit] Public Constructors

[edit] public MergeCursor(Cursor[ ] cursors)

[edit] Public Methods

[edit] public int count()

Returns the numbers of rows in the cursor.

[edit] public void deactivate()

Deactivates the Cursor, making all calls on it fail until requery() is called. Inactive Cursors use fewer resources than active Cursors. Calling requery() will make the cursor active again.

[edit] public boolean deleteRow()

Removes the row at the current cursor position from the underlying data store. After this method returns the cursor will be pointing to the row after the row that is deleted. This has the side effect of decrementing the result of count() by one.

[edit] public String[ ]getColumnNames()

Returns a string array holding the names of all of the columns in the result set in the order in which they were listed in the result.

[edit] public double getDouble(int column)

Returns the value of the requested column as a double.

If the native content of that column is not numeric the result will be the result of passing the column value to Double.valueOf(x).

[edit] public float getFloat(int column)

Returns the value of the requested column as a float.

If the native content of that column is not numeric the result will be the result of passing the column value to Float.valueOf(x).

[edit] public int getInt(int column)

Returns the value of the requested column as an int.

If the native content of that column is not numeric the result will be the result of passing the column value to Integer.valueOf(x).

[edit] public long getLong(int column)

Returns the value of the requested column as a long.

If the native content of that column is not numeric the result will be the result of passing the column value to Long.valueOf(x).

[edit] public short getShort(int column)

Returns the value of the requested column as a short.

If the native content of that column is not numeric the result will be the result of passing the column value to Short.valueOf(x).

[edit] public String getString(int column)

Returns the value of the requested column as a String.

If the native content of that column is not text the result will be the result of passing the column value to String.valueOf(x).

[edit] public boolean isNull(int column)

Returns true if the value in the indicated column is null.

[edit] public void registerContentObserver(ContentObserver observer)

Register an observer that is called when changes happen to the content backing this cursor. Typically the data set won't change until requery() is called.

[edit] public boolean requery()

Performs the query that created the cursor again, refreshing its contents. This may be done at any time, including after a call to deactivate().

[edit] public void unregisterContentObserver(ContentObserver observer)

Unregister an observer that has previously been registered with this cursor via registerContentObserver(ContentObserver).

[edit] Protected Methods

[edit] protected boolean onMove(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.

Parameters

oldPosition the position that we're moving from
newPosition the position that we're moving to

[edit] References

Personal tools