it.unimi.dsi.mg4j.search.score
Class AbstractIndexScorer

java.lang.Object
  extended by it.unimi.dsi.fastutil.ints.AbstractIntIterator
      extended by it.unimi.dsi.mg4j.search.score.AbstractScorer
          extended by it.unimi.dsi.mg4j.search.score.AbstractIndexScorer
All Implemented Interfaces:
IntIterator, FlyweightPrototype<Scorer>, Scorer, Iterator<Integer>
Direct Known Subclasses:
AbstractWeightedScorer

public abstract class AbstractIndexScorer
extends AbstractScorer

An abstract subclass of AbstractScorer. It provides additionally caching of the indices used by the current iterator for scorers that actually use multiple indices.


Field Summary
protected  Index[] currIndex
          An array containing the indices in DocumentIterator.indices() for AbstractScorer.documentIterator; it is set up by wrap(DocumentIterator).
protected  int n
          The current number of elements in currIndex.
 
Fields inherited from class it.unimi.dsi.mg4j.search.score.AbstractScorer
documentIterator
 
Constructor Summary
AbstractIndexScorer()
           
 
Method Summary
 void wrap(DocumentIterator documentIterator)
          Wraps the given document iterator.
 
Methods inherited from class it.unimi.dsi.mg4j.search.score.AbstractScorer
hasNext, nextDocument, nextInt, setWeights, skip
 
Methods inherited from class it.unimi.dsi.fastutil.ints.AbstractIntIterator
next, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.mg4j.search.score.Scorer
copy, score, score, usesIntervals
 
Methods inherited from interface java.util.Iterator
next, remove
 

Field Detail

n

protected int n
The current number of elements in currIndex.


currIndex

protected Index[] currIndex
An array containing the indices in DocumentIterator.indices() for AbstractScorer.documentIterator; it is set up by wrap(DocumentIterator).

Constructor Detail

AbstractIndexScorer

public AbstractIndexScorer()
Method Detail

wrap

public void wrap(DocumentIterator documentIterator)
          throws IOException
Wraps the given document iterator.

Besides the services provided by AbstractScorer.wrap(DocumentIterator), this method sets up currIndex so that it refers to the indices actually used in documentIterator.

Specified by:
wrap in interface Scorer
Overrides:
wrap in class AbstractScorer
Parameters:
documentIterator - the document iterator that will be used in subsequent calls to Scorer.score() and Scorer.score(Index).
Throws:
IOException