T
- Type of the entity.public interface ObjectCursor<T>
extends java.lang.Iterable<T>, java.io.Closeable
T
which works on the original Cursor
. Cursor
is changed, the position of the ObjectCursor
is also changed
and vice versa.ObjectCursor
with an CursorUtil.getObjectCursor(Cursor cursor)
from a Cursor
resolved with a ContentResolver
from a ContentProvider
derived by BaseContentProvider
.Modifier and Type | Method and Description |
---|---|
java.util.Collection<T> |
getAll() |
T |
getCurrent() |
T |
getFirst() |
T |
getLast() |
T |
getNext()
Returns the element at the next position of the
ObjectCursor . |
java.util.Collection<T> |
getNext(int amount) |
T |
getOne() |
int |
getPosition() |
T |
getPrevious() |
java.util.Collection<T> |
getPrevious(int amount) |
boolean |
hasNext() |
boolean |
hasPrevious() |
boolean |
isClosed() |
java.util.Iterator<T> |
iterator() |
boolean |
moveToFirst()
Move the cursor to the first row.
|
boolean |
moveToLast()
Move the cursor to the last row.
|
boolean |
moveToNext()
Move the cursor to the next row.
|
boolean |
moveToPosition(int position)
Move the cursor to an absolute position.
|
boolean |
moveToPrevious()
Move the cursor to the previous row.
|
int |
size() |
java.util.Collection<T> getAll()
Collection
containing all elements contained in this ObjectCursor
. If the
ObjectCursor
is empty an empty Collection
is returned.T getCurrent()
ObjectCursor
.
Cursor
is before the first element, the position is changed to the first position, if the
Cursor
is after the last element, the position is changed to the last elements positionjava.util.NoSuchElementException
- if there are no elements to be returned.T getFirst()
ObjectCursor
.
Cursor
is moved to the first position.java.util.NoSuchElementException
- if there is no element to be returned.T getLast()
ObjectCursor
.
Cursor
is moved to the last position.java.util.NoSuchElementException
- if there is no element to be returned.T getNext()
ObjectCursor
.
Cursor
is moved to the next position.java.util.NoSuchElementException
- if there is no element to be returned.hasNext()
java.util.Collection<T> getNext(int amount)
amount
- Number of positions to move forwardCollection
containing the next amount
elements contained in this
ObjectCursor
. If the ObjectCursor
contains less than amount
elements
following the current position a collection with less than amount
elements is returned.java.util.NoSuchElementException
- if there are no next elements at allT getOne()
ObjectCursor
. It is expected, that the Cursor
contains exactly one element.java.util.NoSuchElementException
- if there is no element to be returned.java.lang.IllegalStateException
- if the Cursor
contains more than one elementT getPrevious()
ObjectCursor
.
Cursor
is moved to the previous position.java.util.NoSuchElementException
- if there is no element to be returned.hasPrevious()
java.util.Collection<T> getPrevious(int amount)
amount
- Number of positions to move backwardsCollection
containing the previous amount
elements contained in this
ObjectCursor
. If the ObjectCursor
contains less than amount
elements
preceding the current position a collection with less than amount
elements is returned.java.util.NoSuchElementException
- if there are no preceding elements at allboolean hasNext()
true
if there is at least one more element after the current position, false
otherwise.getNext()
boolean hasPrevious()
true
if there is at least one more element before the current position, false
otherwise.getPrevious()
java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
Iterator
which does not support the Iterator.remove()
operation.Iterable.iterator()
int size()
ObjectCursor
contains.boolean isClosed()
true
if this ObjectCursor
is closed, otherwise false
;int getPosition()
boolean moveToPosition(int position)
position
- Position to move totrue
if the move was succesful.boolean moveToFirst()
true
if the move was succesful.boolean moveToLast()
true
if the move was succesful.boolean moveToNext()
true
if the move was succesful.boolean moveToPrevious()
true
if the move was succesful.Copyright © 2015 arconsis IT-Solutions GmbH. All Rights Reserved.