it.unimi.di.mg4j.search.visitor
Class TrueTermsCollectionVisitor

java.lang.Object
  extended by it.unimi.di.mg4j.search.visitor.AbstractDocumentIteratorVisitor
      extended by it.unimi.di.mg4j.search.visitor.TrueTermsCollectionVisitor
All Implemented Interfaces:
DocumentIteratorVisitor<Boolean>

public class TrueTermsCollectionVisitor
extends AbstractDocumentIteratorVisitor

A visitor collecting terms that satisfy a query for the current document.

True terms are terms reachable by true paths. This visitor collects true terms are exposes them in the public trueTerms variable, in the order in which they appear in a visit of the iterator.


Field Summary
 ArrayList<String> trueTerms
          The list of true terms collected in the last visit.
 
Constructor Summary
TrueTermsCollectionVisitor()
          Creates a new visitor collecting true terms.
 
Method Summary
 AbstractDocumentIteratorVisitor prepare()
          Prepares the internal state of this visitor for a(nother) visit.
 String toString()
           
 Boolean visit(IndexIterator indexIterator)
          Visits an IndexIterator leaf.
 Boolean visit(MultiTermIndexIterator multiTermIndexIterator)
          Visits a MultiTermIndexIterator leaf.
 
Methods inherited from class it.unimi.di.mg4j.search.visitor.AbstractDocumentIteratorVisitor
newArray, visit, visit, visitPost, visitPre
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

trueTerms

public final ArrayList<String> trueTerms
The list of true terms collected in the last visit.

Constructor Detail

TrueTermsCollectionVisitor

public TrueTermsCollectionVisitor()
Creates a new visitor collecting true terms.

Method Detail

prepare

public AbstractDocumentIteratorVisitor prepare()
Description copied from interface: DocumentIteratorVisitor
Prepares the internal state of this visitor for a(nother) visit.

By specification, it must be safe to call this method any number of times.

Specified by:
prepare in interface DocumentIteratorVisitor<Boolean>
Overrides:
prepare in class AbstractDocumentIteratorVisitor
Returns:
this visitor.

visit

public Boolean visit(IndexIterator indexIterator)
              throws IOException
Description copied from interface: DocumentIteratorVisitor
Visits an IndexIterator leaf.

Parameters:
indexIterator - the leaf to be visited.
Returns:
an appropriate return value if the visit should continue, or null.
Throws:
IOException

visit

public Boolean visit(MultiTermIndexIterator multiTermIndexIterator)
              throws IOException
Description copied from interface: DocumentIteratorVisitor
Visits a MultiTermIndexIterator leaf.

Specified by:
visit in interface DocumentIteratorVisitor<Boolean>
Overrides:
visit in class AbstractDocumentIteratorVisitor
Parameters:
multiTermIndexIterator - the leaf to be visited.
Returns:
an appropriate return value if the visit should continue, or null.
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object