org.apache.lucene.facet.util
Class MultiCategoryListIterator

java.lang.Object
  extended by org.apache.lucene.facet.util.MultiCategoryListIterator
All Implemented Interfaces:
CategoryListIterator

public class MultiCategoryListIterator
extends Object
implements CategoryListIterator

Iterates over multiple CategoryListIterators, consuming the provided iterators in order.

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

Constructor Summary
MultiCategoryListIterator(CategoryListIterator... iterators)
          Receives the iterators to iterate on
 
Method Summary
 void getOrdinals(int docID, IntsRef ints)
          Stores the category ordinals of the given document ID in the given IntsRef, starting at position 0 upto IntsRef.length.
 boolean setNextReader(AtomicReaderContext context)
          Sets the AtomicReaderContext for which CategoryListIterator.getOrdinals(int, IntsRef) calls will be made.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiCategoryListIterator

public MultiCategoryListIterator(CategoryListIterator... iterators)
Receives the iterators to iterate on

Method Detail

setNextReader

public boolean setNextReader(AtomicReaderContext context)
                      throws IOException
Description copied from interface: CategoryListIterator
Sets the AtomicReaderContext for which CategoryListIterator.getOrdinals(int, IntsRef) calls will be made. Returns true iff any of the documents in this reader have category ordinals. This method must be called before any calls to CategoryListIterator.getOrdinals(int, IntsRef).

Specified by:
setNextReader in interface CategoryListIterator
Throws:
IOException

getOrdinals

public void getOrdinals(int docID,
                        IntsRef ints)
                 throws IOException
Description copied from interface: CategoryListIterator
Stores the category ordinals of the given document ID in the given IntsRef, starting at position 0 upto IntsRef.length. Grows the IntsRef if it is not large enough.

NOTE: if the requested document does not have category ordinals associated with it, IntsRef.length is set to zero.

Specified by:
getOrdinals in interface CategoryListIterator
Throws:
IOException


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.