public class IteratorCursor<S> extends AbstractCursor<S>
Constructor and Description |
---|
IteratorCursor(java.lang.Iterable<S> iterable) |
IteratorCursor(java.lang.Iterable<S> iterable,
java.util.concurrent.locks.Lock lock) |
IteratorCursor(java.util.Iterator<S> iterator) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Call close to release any resources being held by this cursor.
|
boolean |
hasNext()
Returns true if this cursor has more elements.
|
S |
next()
Returns the next element from this cursor.
|
public IteratorCursor(java.lang.Iterable<S> iterable)
iterable
- collection to iterate over, or null for empty cursorpublic IteratorCursor(java.lang.Iterable<S> iterable, java.util.concurrent.locks.Lock lock)
iterable
- collection to iterate over, or null for empty cursorlock
- optional lock to hold while cursor is openpublic IteratorCursor(java.util.Iterator<S> iterator)
iterator
- iterator to wrap, or null for empty cursorpublic void close()
Cursor
public boolean hasNext()
Cursor
next
would return an element rather than throwing
an exception.Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.