public abstract class AbstractCursor<S> extends java.lang.Object implements Cursor<S>
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCursor() |
| Modifier and Type | Method and Description |
|---|---|
int |
copyInto(java.util.Collection<? super S> c)
Copies all remaining next elements into the given collection.
|
int |
copyInto(java.util.Collection<? super S> c,
int limit)
Copies a limited amount of remaining next elements into the given
collection.
|
int |
skipNext(int amount)
Skips forward by the specified amount of elements, returning the actual
amount skipped.
|
java.util.List<S> |
toList()
Copies all remaining next elements into a new modifiable list.
|
java.util.List<S> |
toList(int limit)
Copies a limited amount of remaining next elements into a new modifiable
list.
|
public int copyInto(java.util.Collection<? super S> c) throws FetchException
Cursor
Cursor cursor;
...
while (cursor.hasNext()) {
c.add(cursor.next());
}
As a side-effect of calling this method, the cursor is closed.
copyInto in interface Cursor<S>FetchException - if storage layer throws an exceptionpublic int copyInto(java.util.Collection<? super S> c, int limit) throws FetchException
Cursor
Cursor cursor;
...
while (--limit >= 0 && cursor.hasNext()) {
c.add(cursor.next());
}
copyInto in interface Cursor<S>limit - maximum amount of elements to copyFetchException - if storage layer throws an exceptionpublic java.util.List<S> toList() throws FetchException
CursorCursor<S> cursor; ... List<S> list = new ... cursor.copyInto(list);
As a side-effect of calling this method, the cursor is closed.
toList in interface Cursor<S>FetchException - if storage layer throws an exceptionpublic java.util.List<S> toList(int limit) throws FetchException
CursorCursor<S> cursor; ... List<S> list = new ... cursor.copyInto(list, limit);
toList in interface Cursor<S>limit - maximum amount of elements to copyFetchException - if storage layer throws an exceptionpublic int skipNext(int amount)
throws FetchException
CursorskipNext in interface Cursor<S>amount - maximum amount of elements to skipFetchException - if storage layer throws an exceptionCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.