org.galagosearch.core.retrieval.structured
Class ExtentDisjunctionIterator

java.lang.Object
  extended by org.galagosearch.core.retrieval.structured.CountIterator
      extended by org.galagosearch.core.retrieval.structured.ExtentIterator
          extended by org.galagosearch.core.retrieval.structured.ExtentDisjunctionIterator
All Implemented Interfaces:
java.lang.Comparable<CountIterator>, StructuredIterator
Direct Known Subclasses:
SynonymIterator

public abstract class ExtentDisjunctionIterator
extends ExtentIterator

This class is meant to be a base class for many kinds of iterators that require at least one of their children to be present in the document for a match to happen. This class will call loadExtents once for each document that has a match on any child iterator.

Author:
trevor

Field Summary
protected  int document
           
protected  ExtentArray extents
           
protected  java.util.PriorityQueue<ExtentIterator> iterators
           
protected  ExtentIterator[] original
           
 
Constructor Summary
ExtentDisjunctionIterator(ExtentIterator[] iterators)
           
 
Method Summary
 int count()
          Returns the number of occurrences of this iterator's term in the current document.
 int document()
          Returns the current document.
 ExtentArray extents()
           
 boolean isDone()
          Returns true if there is no data left in the list and false otherwise.
abstract  void loadExtents()
           
 void nextDocument()
          Moves the iterator to the next document in the list.
 void reset()
          Resets the position of this iterator to the start of the list.
 
Methods inherited from class org.galagosearch.core.retrieval.structured.ExtentIterator
skipToDocument
 
Methods inherited from class org.galagosearch.core.retrieval.structured.CountIterator
compareTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

original

protected ExtentIterator[] original

iterators

protected java.util.PriorityQueue<ExtentIterator> iterators

document

protected int document

extents

protected ExtentArray extents
Constructor Detail

ExtentDisjunctionIterator

public ExtentDisjunctionIterator(ExtentIterator[] iterators)
Method Detail

loadExtents

public abstract void loadExtents()

nextDocument

public void nextDocument()
                  throws java.io.IOException
Description copied from class: CountIterator
Moves the iterator to the next document in the list. If no such document is available, isDone() will return true after this method is called.

Specified by:
nextDocument in class ExtentIterator
Throws:
java.io.IOException

isDone

public boolean isDone()
Description copied from class: CountIterator
Returns true if there is no data left in the list and false otherwise. If the result of this method is true, the data returned from document() and count() is meaningless.

Specified by:
isDone in class ExtentIterator

extents

public ExtentArray extents()
Specified by:
extents in class ExtentIterator

document

public int document()
Description copied from class: CountIterator
Returns the current document.

Specified by:
document in class ExtentIterator

count

public int count()
Description copied from class: CountIterator
Returns the number of occurrences of this iterator's term in the current document.

Specified by:
count in class ExtentIterator

reset

public void reset()
           throws java.io.IOException
Description copied from class: CountIterator
Resets the position of this iterator to the start of the list.

Specified by:
reset in interface StructuredIterator
Specified by:
reset in class ExtentIterator
Throws:
java.io.IOException


Copyright © 2009. All Rights Reserved.