java.lang.Object | |
↳ | android.database.CursorJoiner |
Does a join on two cursors using the specified columns. The cursors must already be sorted on each of the specified columns in ascending order. This joiner only supports the case where the tuple of key column values is unique.
Typical usage:
CursorJoiner joiner = new CursorJoiner(cursorA, keyColumnsofA, cursorB, keyColumnsofB); for (CursorJointer.Result joinerResult : joiner) { switch (joinerResult) { case LEFT: // handle case where a row in cursorA is unique break; case RIGHT: // handle case where a row in cursorB is unique break; case BOTH: // handle case where a row with the same key is in both cursors break; } }
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
CursorJoiner.Result | The result of a call to next(). |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Initializes the CursorJoiner and resets the cursors to the first row.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
Returns whether or not there are more rows to compare using next().
|
||||||||||
|
Returns an
Iterator
for the elements in this object.
|
||||||||||
|
Returns the comparison result of the next row from each cursor.
|
||||||||||
|
Removes the last object returned by
next
from the collection.
|
[Expand]
Inherited Methods
|
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
|||||||||||
From interface
java.lang.Iterable
|
|||||||||||
From interface
java.util.Iterator
|
Initializes the CursorJoiner and resets the cursors to the first row. The left and right column name arrays must have the same number of columns.
cursorLeft | The left cursor to compare |
---|---|
columnNamesLeft | The column names to compare from the left cursor |
cursorRight | The right cursor to compare |
columnNamesRight | The column names to compare from the right cursor |
Returns whether or not there are more rows to compare using next().
Returns an
Iterator
for the elements in this object.
Iterator
instance.
Returns the comparison result of the next row from each cursor. If one cursor has no more rows but the other does then subsequent calls to this will indicate that the remaining rows are unique.
The caller must check that hasNext() returns true before calling this.
Once next() has been called the cursors specified in the result of the call to next() are guaranteed to point to the row that was indicated. Reading values from the cursor that was not indicated in the call to next() will result in undefined behavior.
Removes the last object returned by
next
from the collection.
This method can only be called once between each call to
next
.