V
- type of the objects contained in the result set.public class SimpleObjectResultSet<V> extends AbstractObjectResultSet<V>
Simple ObjectResultSet
implementation. This implementation simply
returns the elements from a single iterator (or iterable).
Like indicated for the ObjectResultSet
interface, this class is
not thread safe.
ObjectResultSet.ObjectResultSetIterator<V>
Modifier and Type | Method and Description |
---|---|
protected ListenableFuture<Iterator<V>> |
fetchNextPage()
Fetches the next page of objects.
|
static <V> SimpleObjectResultSet<V> |
fromIterable(Iterable<V> iterable)
Creates a result set that contains the objects from the specified
iterable.
|
static <V> SimpleObjectResultSet<V> |
fromIterator(Iterator<V> iterator)
Creates a result set that contains the objects returned by the specified
iterator.
|
all, fetchMoreResults, getAvailableWithoutFetching, isExhausted, isFullyFetched, iterator, one
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static <V> SimpleObjectResultSet<V> fromIterable(Iterable<V> iterable)
fromIterator(iterable.iterator())
.V
- type of the objects contained in the result set.iterable
- iterable with the objects that will be returned by this result
set.NullPointerException
- if iterable
is null
.public static <V> SimpleObjectResultSet<V> fromIterator(Iterator<V> iterator)
null
, the result set is empty.
This is a convenience method calling the SimpleV
- type of the objects contained in the result set.iterator
- iterator returning the objects that will be returned by this
result set.protected ListenableFuture<Iterator<V>> fetchNextPage()
AbstractObjectResultSet
Fetches the next page of objects. This method must be implemented by child classes and its implementation must not block.
This method start the fetching of the next page of objects and returns a
future that provides access to the objects once they have been fetched.
If there are no more objects, the future returned by this method must
return null
.
The abstract base class guarantees that this method is only called when the future returned by an earlier call is done and has yielded a non-null result.
fetchNextPage
in class AbstractObjectResultSet<V>
null
if there are no more objects in the result set.Copyright © 2011–2016 aquenos GmbH. All rights reserved.