java.lang.Object
org.lmdbjava.CursorIterable<T>
- Type Parameters:
T- buffer type
- All Implemented Interfaces:
AutoCloseable,Iterable<CursorIterable.KeyVal<T>>
public final class CursorIterable<T>
extends Object
implements Iterable<CursorIterable.KeyVal<T>>, AutoCloseable
Iterable that creates a single Iterator that will iterate
over a Cursor as specified by a KeyRange.
An instance will create and close its own cursor.
If iterating over keys stored with DbiFlags.MDB_INTEGERKEY you must
provide a Java comparator when constructing the Dbi or this class. It
is more efficient to use a comparator only with this class, as this avoids
LMDB calling back into Java code to perform the integer key comparison.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classHolder for a key and value pair. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
iterator
Obtain an iterator.As iteration of the returned iterator will cause movement of the underlying LMDB cursor, an
IllegalStateExceptionis thrown if an attempt is made to obtain the iterator more than once. For advanced cursor control (such as being able to iterate over the same data multiple times etc) please instead refer toDbi.openCursor(org.lmdbjava.Txn).
-