Interface CategoryListIterator

  • All Known Implementing Classes:
    MultiCategoryListIterator, PayloadIntDecodingIterator

    public interface CategoryListIterator
    An interface for iterating over a "category list", i.e., the list of categories per document.

    NOTE:

    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Method Detail

      • init

        boolean init()
              throws IOException
        Initializes the iterator. This method must be called before any calls to 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.
        NOTE: calling this method twice may result in skipping over documents for some implementations. Also, calling it again after all documents were consumed may yield unexpected behavior.
        Throws:
        IOException
      • skipTo

        boolean skipTo​(int docId)
                throws IOException
        Skips forward to document docId. Returns true iff this document exists and has any categories. This method must be called before calling nextCategory() for a particular document.
        NOTE: Users should call this method with increasing docIds, and implementations can assume that this is the case.
        Throws:
        IOException
      • nextCategory

        long nextCategory()
                   throws IOException
        Returns the next category for the current document that is set through skipTo(int), or a number higher than Integer.MAX_VALUE. No assumptions can be made on the order of the categories.
        Throws:
        IOException