|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.database.AbstractCursor
android.database.MergeCursor
public class 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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.database.AbstractCursor |
|---|
AbstractCursor.SelfContentObserver |
| Field Summary |
|---|
| Fields inherited from class android.database.AbstractCursor |
|---|
mClosed, mContentObservable, mContentResolver, mCurrentRowID, mDataSetObservable, mPos, mRowIdColumnIndex, mUpdatedRows |
| Constructor Summary | |
|---|---|
MergeCursor(Cursor[] cursors)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes the Cursor, releasing all of its resources and making it completely invalid. |
boolean |
commitUpdates()
Deprecated. |
void |
deactivate()
Deactivates the Cursor, making all calls on it fail until Cursor.requery() is called. |
boolean |
deleteRow()
Deprecated. |
byte[] |
getBlob(int column)
Returns the value of the requested column as a byte array. |
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. |
int |
getCount()
Returns the numbers of rows in the cursor. |
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. |
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. |
void |
registerContentObserver(ContentObserver observer)
Register an observer that is called when changes happen to the content backing this cursor. |
void |
registerDataSetObserver(DataSetObserver observer)
Register an observer that is called when changes happen to the contents of the this cursors data set, for example, when the data set is changed via Cursor.requery(), Cursor.deactivate(), or Cursor.close(). |
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 Cursor.registerContentObserver(android.database.ContentObserver). |
void |
unregisterDataSetObserver(DataSetObserver observer)
Unregister an observer that has previously been registered with this cursor via Cursor.registerContentObserver(android.database.ContentObserver). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MergeCursor(Cursor[] cursors)
| Method Detail |
|---|
public int getCount()
Cursor
getCount in interface CursorgetCount in class AbstractCursor
public boolean onMove(int oldPosition,
int newPosition)
AbstractCursor
onMove in interface CrossProcessCursoronMove in class AbstractCursoroldPosition - the position that we're moving fromnewPosition - the position that we're moving to
public boolean deleteRow()
CursorThe query must have the row ID column in its selection, otherwise this call will fail.
deleteRow in interface CursordeleteRow in class AbstractCursorpublic boolean commitUpdates()
CursorCursor.requery() before reading data from the cursor again.
commitUpdates in interface CursorcommitUpdates in class AbstractCursorpublic String getString(int column)
CursorIf the native content of that column is not text the result will be the result of passing the column value to String.valueOf(x).
getString in interface CursorgetString in class AbstractCursorcolumn - the zero-based index of the target column.
public short getShort(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Short.valueOf(x).
getShort in interface CursorgetShort in class AbstractCursorcolumn - the zero-based index of the target column.
public int getInt(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Integer.valueOf(x).
getInt in interface CursorgetInt in class AbstractCursorcolumn - the zero-based index of the target column.
public long getLong(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Long.valueOf(x).
getLong in interface CursorgetLong in class AbstractCursorcolumn - the zero-based index of the target column.
public float getFloat(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Float.valueOf(x).
getFloat in interface CursorgetFloat in class AbstractCursorcolumn - the zero-based index of the target column.
public double getDouble(int column)
CursorIf the native content of that column is not numeric the result will be the result of passing the column value to Double.valueOf(x).
getDouble in interface CursorgetDouble in class AbstractCursorcolumn - the zero-based index of the target column.
public boolean isNull(int column)
Cursortrue if the value in the indicated column is null.
isNull in interface CursorisNull in class AbstractCursorcolumn - the zero-based index of the target column.
public byte[] getBlob(int column)
CursorIf the native content of that column is not blob exception may throw
getBlob in interface CursorgetBlob in class AbstractCursorcolumn - the zero-based index of the target column.
public String[] getColumnNames()
Cursor
getColumnNames in interface CursorgetColumnNames in class AbstractCursorpublic void deactivate()
CursorCursor.requery() is called.
Inactive Cursors use fewer resources than active Cursors.
Calling Cursor.requery() will make the cursor active again.
deactivate in interface Cursordeactivate in class AbstractCursorpublic void close()
CursorCursor.deactivate() a call to Cursor.requery() will not make the Cursor valid
again.
close in interface Cursorclose in class AbstractCursorpublic void registerContentObserver(ContentObserver observer)
CursorCursor.requery() is called.
registerContentObserver in interface CursorregisterContentObserver in class AbstractCursorobserver - the object that gets notified when the content backing the cursor changes.Cursor.unregisterContentObserver(ContentObserver)public void unregisterContentObserver(ContentObserver observer)
CursorCursor.registerContentObserver(android.database.ContentObserver).
unregisterContentObserver in interface CursorunregisterContentObserver in class AbstractCursorobserver - the object to unregister.Cursor.registerContentObserver(ContentObserver)public void registerDataSetObserver(DataSetObserver observer)
CursorCursor.requery(), Cursor.deactivate(), or Cursor.close().
registerDataSetObserver in interface CursorregisterDataSetObserver in class AbstractCursorobserver - the object that gets notified when the cursors data set changes.Cursor.unregisterDataSetObserver(DataSetObserver)public void unregisterDataSetObserver(DataSetObserver observer)
CursorCursor.registerContentObserver(android.database.ContentObserver).
unregisterDataSetObserver in interface CursorunregisterDataSetObserver in class AbstractCursorobserver - the object to unregister.Cursor.registerDataSetObserver(DataSetObserver)public boolean requery()
CursorCursor.deactivate().
requery in interface Cursorrequery in class AbstractCursor
|
Build 1.1_r1 (from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||