java.io.Closeable, java.lang.AutoCloseable, java.util.Iterator<java.util.Map.Entry<byte[],byte[]>>@Public
@Evolving
public class LeveldbIterator
extends java.lang.Object
implements java.util.Iterator<java.util.Map.Entry<byte[],byte[]>>, java.io.Closeable
| Constructor | Description |
|---|---|
LeveldbIterator(org.iq80.leveldb.DB db) |
Create an iterator for the specified database.
|
LeveldbIterator(org.iq80.leveldb.DBIterator iter) |
Create an iterator using the specified underlying DBIterator.
|
LeveldbIterator(org.iq80.leveldb.DB db,
org.iq80.leveldb.ReadOptions options) |
Create an iterator for the specified database.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes the iterator.
|
boolean |
hasNext() |
Returns true if the iteration has more elements.
|
boolean |
hasPrev() |
|
java.util.Map.Entry<byte[],byte[]> |
next() |
Returns the next element in the iteration.
|
java.util.Map.Entry<byte[],byte[]> |
peekNext() |
Returns the next element in the iteration, without advancing the
iteration.
|
java.util.Map.Entry<byte[],byte[]> |
peekPrev() |
|
java.util.Map.Entry<byte[],byte[]> |
prev() |
|
void |
remove() |
Removes from the database the last element returned by the iterator.
|
void |
seek(byte[] key) |
Repositions the iterator so the key of the next BlockElement
returned greater than or equal to the specified targetKey.
|
void |
seekToFirst() |
Repositions the iterator so is is at the beginning of the Database.
|
void |
seekToLast() |
Repositions the iterator so it is at the end of of the Database.
|
public LeveldbIterator(org.iq80.leveldb.DB db)
db - database.public LeveldbIterator(org.iq80.leveldb.DB db,
org.iq80.leveldb.ReadOptions options)
db - db.options - ReadOptions.public LeveldbIterator(org.iq80.leveldb.DBIterator iter)
iter - DB Iterator.public void seek(byte[] key)
throws org.iq80.leveldb.DBException
key - key of the next BlockElement.org.iq80.leveldb.DBException - db Exception.public void seekToFirst()
throws org.iq80.leveldb.DBException
org.iq80.leveldb.DBExceptionpublic void seekToLast()
throws org.iq80.leveldb.DBException
org.iq80.leveldb.DBExceptionpublic boolean hasNext()
throws org.iq80.leveldb.DBException
hasNext in interface java.util.Iterator<java.util.Map.Entry<byte[],byte[]>>org.iq80.leveldb.DBExceptionpublic java.util.Map.Entry<byte[],byte[]> next()
throws org.iq80.leveldb.DBException
next in interface java.util.Iterator<java.util.Map.Entry<byte[],byte[]>>org.iq80.leveldb.DBException - DB Exception.public java.util.Map.Entry<byte[],byte[]> peekNext()
throws org.iq80.leveldb.DBException
org.iq80.leveldb.DBException - db Exception.public boolean hasPrev()
throws org.iq80.leveldb.DBException
org.iq80.leveldb.DBExceptionpublic java.util.Map.Entry<byte[],byte[]> prev()
throws org.iq80.leveldb.DBException
org.iq80.leveldb.DBExceptionpublic java.util.Map.Entry<byte[],byte[]> peekPrev()
throws org.iq80.leveldb.DBException
org.iq80.leveldb.DBExceptionpublic void remove()
throws org.iq80.leveldb.DBException
remove in interface java.util.Iterator<java.util.Map.Entry<byte[],byte[]>>org.iq80.leveldb.DBExceptionpublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.io.IOExceptionCopyright © 2008–2025 Apache Software Foundation. All rights reserved.