public class MergeCursor extends AbstractCursor
mClosed, mCurrentRowID, mPos, mRowIdColumnIndex, mUpdatedRowsFIELD_TYPE_BLOB, FIELD_TYPE_FLOAT, FIELD_TYPE_INTEGER, FIELD_TYPE_NULL, FIELD_TYPE_STRING| Constructor and Description |
|---|
MergeCursor(Cursor[] cursors) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the Cursor, releasing all of its resources and making it completely invalid.
|
void |
deactivate()
Deactivates the Cursor, making all calls on it fail until
Cursor.requery() is called. |
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.
|
int |
getType(int column)
Returns data type of the given column's value.
|
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 |
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 |
unregisterDataSetObserver(DataSetObserver observer)
Unregister an observer that has previously been registered with this
cursor via
#registerContentObserver. |
checkPosition, copyStringToBuffer, fillWindow, finalize, getColumnCount, getColumnIndex, getColumnIndexOrThrow, getColumnName, getExtras, getPosition, getUpdatedField, getWantsAllOnMoveCalls, getWindow, isAfterLast, isBeforeFirst, isClosed, isFieldUpdated, isFirst, isLast, move, moveToFirst, moveToLast, moveToNext, moveToPosition, moveToPrevious, onChange, onDeactivateOrClose, respond, setExtraspublic MergeCursor(Cursor[] cursors)
public int getCount()
CursorgetCount in interface CursorgetCount in class AbstractCursorpublic boolean onMove(int oldPosition,
int newPosition)
AbstractCursoronMove in interface CrossProcessCursoronMove in class AbstractCursoroldPosition - the position that we're moving fromnewPosition - the position that we're moving topublic String getString(int column)
CursorThe result and whether this method throws an exception when the column value is null or the column type is not a string type is implementation-defined.
getString in interface CursorgetString in class AbstractCursorcolumn - the zero-based index of the target column.public short getShort(int column)
CursorThe result and whether this method throws an exception when the
column value is null, the column type is not an integral type, or the
integer value is outside the range [Short.MIN_VALUE,
Short.MAX_VALUE] is implementation-defined.
getShort in interface CursorgetShort in class AbstractCursorcolumn - the zero-based index of the target column.public int getInt(int column)
CursorThe result and whether this method throws an exception when the
column value is null, the column type is not an integral type, or the
integer value is outside the range [Integer.MIN_VALUE,
Integer.MAX_VALUE] is implementation-defined.
getInt in interface CursorgetInt in class AbstractCursorcolumn - the zero-based index of the target column.public long getLong(int column)
CursorThe result and whether this method throws an exception when the
column value is null, the column type is not an integral type, or the
integer value is outside the range [Long.MIN_VALUE,
Long.MAX_VALUE] is implementation-defined.
getLong in interface CursorgetLong in class AbstractCursorcolumn - the zero-based index of the target column.public float getFloat(int column)
CursorThe result and whether this method throws an exception when the
column value is null, the column type is not a floating-point type, or the
floating-point value is not representable as a float value is
implementation-defined.
getFloat in interface CursorgetFloat in class AbstractCursorcolumn - the zero-based index of the target column.public double getDouble(int column)
CursorThe result and whether this method throws an exception when the
column value is null, the column type is not a floating-point type, or the
floating-point value is not representable as a double value is
implementation-defined.
getDouble in interface CursorgetDouble in class AbstractCursorcolumn - the zero-based index of the target column.public int getType(int column)
CursorCursor.getInt(int), Cursor.getFloat(int)
etc.
Returned column types are
getType in interface CursorgetType 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)
CursorThe result and whether this method throws an exception when the column value is null or the column type is not a blob type is implementation-defined.
getBlob in interface CursorgetBlob in class AbstractCursorcolumn - the zero-based index of the target column.public String[] getColumnNames()
CursorgetColumnNames 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 interface Closeableclose in interface AutoCloseableclose in class AbstractCursorpublic 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)
Cursor#registerContentObserver.unregisterDataSetObserver in interface CursorunregisterDataSetObserver in class AbstractCursorobserver - the object to unregister.Cursor.registerDataSetObserver(DataSetObserver)public boolean requery()
CursorCursor.deactivate().
Since this method could execute a query on the database and potentially take
a while, it could cause ANR if it is called on Main (UI) thread.
A warning is printed if this method is being executed on Main thread.requery in interface Cursorrequery in class AbstractCursor