Why do Android Cursors start before the first row of results, and end after the last row?

Viewed 4765

I'm trying to understand why they would start the cursor before the first position in a row and why it would end after the last position. Is there an inherit advantage to doing it this way?

For example:

public abstract int getPosition () 

Since: API Level 1 Returns the current position of the cursor in the row set. The value is zero-based. When the row set is first returned the cursor will be at position -1, which is before the first row. After the last row is returned another call to next() will leave the cursor past the last entry, at a position of count().

returns the current cursor position.

Thank you.

3 Answers
Related