it.unimi.dsi.mg4j.search
Class AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator

java.lang.Object
  extended by it.unimi.dsi.fastutil.objects.AbstractObjectIterator<Interval>
      extended by it.unimi.dsi.mg4j.search.AbstractDocumentIterator.AbstractIntervalIterator
          extended by it.unimi.dsi.mg4j.search.AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator
All Implemented Interfaces:
ObjectIterator<Interval>, IntervalIterator, Iterator<Interval>
Direct Known Subclasses:
AbstractOrderedIntervalDocumentIterator.AbstractOrderedIndexIntervalIterator, OrDocumentIterator.OrIndexIntervalIterator
Enclosing class:
AbstractCompositeDocumentIterator

protected abstract static class AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator
extends AbstractDocumentIterator.AbstractIntervalIterator

An abstract IndexIterator-based interval iterator. The difference with AbstractCompositeDocumentIterator.AbstractCompositeIntervalIterator is that this class assumes that all document iterators are actually index iterators. The algorithms in this (very common) case can be significantly simplified, obtaining a large gain in performance.


Field Summary
protected  int[] count
          The number of elements of position for each index iterator.
protected  int[] curr
          At any time, curr[ i ] contains position[ i ][ currPos[i ] ].
protected  int[] currPos
          The index of current element of position for each index iterator.
protected  int[][] position
          The position arrays returned by each index iterator.
 
Fields inherited from class it.unimi.dsi.mg4j.search.AbstractDocumentIterator.AbstractIntervalIterator
next
 
Constructor Summary
AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator(int n)
           
 
Method Summary
 String toString()
           
 
Methods inherited from class it.unimi.dsi.mg4j.search.AbstractDocumentIterator.AbstractIntervalIterator
hasNext, next
 
Methods inherited from class it.unimi.dsi.fastutil.objects.AbstractObjectIterator
remove, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.mg4j.search.IntervalIterator
extent, intervalTerms, nextInterval, reset
 
Methods inherited from interface java.util.Iterator
remove
 

Field Detail

position

protected int[][] position
The position arrays returned by each index iterator.


currPos

protected int[] currPos
The index of current element of position for each index iterator.


curr

protected int[] curr
At any time, curr[ i ] contains position[ i ][ currPos[i ] ].


count

protected int[] count
The number of elements of position for each index iterator.

Constructor Detail

AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator

public AbstractCompositeDocumentIterator.AbstractCompositeIndexIntervalIterator(int n)
Method Detail

toString

public String toString()
Overrides:
toString in class Object