public interface CategoryListIterator
NOTE:
hashCode()
and equals()
must be provided.
init()
must be called before you consume any categories, or call
skipTo(int)
.
skipTo(int)
must be called before any calls to
nextCategory()
.
nextCategory()
returns values < Integer.MAX_VALUE
, so
you can use it as a stop condition.
Modifier and Type | Method and Description |
---|---|
boolean |
init()
Initializes the iterator.
|
long |
nextCategory()
Returns the next category for the current document that is set through
skipTo(int) , or a number higher than Integer.MAX_VALUE . |
boolean |
skipTo(int docId)
Skips forward to document docId.
|
boolean init() throws IOException
skipTo(int)
, and its return value indicates whether there are
any relevant documents for this iterator. If it returns false, any call
to skipTo(int)
will return false as well.IOException
boolean skipTo(int docId) throws IOException
nextCategory()
for a particular document.IOException
long nextCategory() throws IOException
skipTo(int)
, or a number higher than Integer.MAX_VALUE
.
No assumptions can be made on the order of the categories.IOException