org.apache.lucene.facet.associations
Class AssociationsPayloadIterator<T extends CategoryAssociation>

java.lang.Object
  extended by org.apache.lucene.facet.associations.AssociationsPayloadIterator<T>
Direct Known Subclasses:
FloatAssociationsPayloadIterator, IntAssociationsPayloadIterator

public abstract class AssociationsPayloadIterator<T extends CategoryAssociation>
extends Object

An iterator over a document's category associations.

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

Constructor Summary
AssociationsPayloadIterator(String field, T association)
          Construct a new associations iterator.
 
Method Summary
protected abstract  void handleAssociation(int ordinal, T association)
          A hook for extending classes to handle the given association value for the ordinal.
protected  boolean setNextDoc(int docID)
          Skip to the requested document.
 boolean setNextReader(AtomicReaderContext context)
          Sets the AtomicReaderContext for which setNextDoc(int) calls will be made.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociationsPayloadIterator

public AssociationsPayloadIterator(String field,
                                   T association)
                            throws IOException
Construct a new associations iterator. The given CategoryAssociation is used to deserialize the association values. It is assumed that all association values can be deserialized with the given CategoryAssociation.

Throws:
IOException
Method Detail

setNextReader

public final boolean setNextReader(AtomicReaderContext context)
                            throws IOException
Sets the AtomicReaderContext for which setNextDoc(int) calls will be made. Returns true iff this reader has associations for any of the documents belonging to the association given to the constructor.

Throws:
IOException

setNextDoc

protected final boolean setNextDoc(int docID)
                            throws IOException
Skip to the requested document. Returns true iff the document has category association values and they were read successfully. Associations are handled through handleAssociation(int, CategoryAssociation) by extending classes.

Throws:
IOException

handleAssociation

protected abstract void handleAssociation(int ordinal,
                                          T association)
A hook for extending classes to handle the given association value for the ordinal.



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