Module org.apache.lucene.suggest
Class ExternalRefSorter.ByteSequenceIterator
- java.lang.Object
-
- org.apache.lucene.search.suggest.fst.ExternalRefSorter.ByteSequenceIterator
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,BytesRefIterator
- Enclosing class:
- ExternalRefSorter
public static class ExternalRefSorter.ByteSequenceIterator extends java.lang.Object implements BytesRefIterator, java.io.Closeable
Iterates overBytesRef
s in a file, closes the reader when the iterator is exhausted.
-
-
Field Summary
Fields Modifier and Type Field Description private OfflineSorter.ByteSequencesReader
reader
-
Fields inherited from interface org.apache.lucene.util.BytesRefIterator
EMPTY
-
-
Constructor Summary
Constructors Modifier Constructor Description private
ByteSequenceIterator(OfflineSorter.ByteSequencesReader reader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
BytesRef
next()
Increments the iteration to the nextBytesRef
in the iterator.
-
-
-
Field Detail
-
reader
private final OfflineSorter.ByteSequencesReader reader
-
-
Constructor Detail
-
ByteSequenceIterator
private ByteSequenceIterator(OfflineSorter.ByteSequencesReader reader)
-
-
Method Detail
-
next
public BytesRef next() throws java.io.IOException
Description copied from interface:BytesRefIterator
Increments the iteration to the nextBytesRef
in the iterator. Returns the resultingBytesRef
ornull
if the end of the iterator is reached. The returned BytesRef may be re-used across calls to next. After this method returns null, do not call it again: the results are undefined.- Specified by:
next
in interfaceBytesRefIterator
- Returns:
- the next
BytesRef
in the iterator ornull
if the end of the iterator is reached. - Throws:
java.io.IOException
- If there is a low-level I/O error.
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-