|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object it.unimi.di.mg4j.search.AbstractDocumentIterator it.unimi.di.mg4j.search.AbstractIntervalDocumentIterator
public abstract class AbstractIntervalDocumentIterator
An abstract iterator on documents that provides basic support for handling interval iterators.
Implementing subclasses must override getIntervalIterator(Index, int, boolean, Object)
so
that it returns the correct interval iterator. Note that because of delays in class initialization, the
constructor of this
class takes a number of apparently disparate parameters: they are necessary to initialize various kinds
of interval iterators. This class provides static methods that help in building the correct value for the parameters
of the constructor.
Field Summary | |
---|---|
protected Index2IntervalIteratorMap |
currentIterators
A map from indices to the iterators returned for the current document. |
protected ReferenceSet<Index> |
indices
The set of indices involved in this iterator. |
protected Index2IntervalIteratorMap |
intervalIterators
A map from indices to interval iterators. |
protected Index |
soleIndex
If not null , the sole index involved in this document iterator. |
protected IntervalIterator |
soleIntervalIterator
If not null , the sole interval iterator involved in this document iterator. |
protected Reference2ReferenceMap<Index,IntervalIterator> |
unmodifiableCurrentIterators
An unmodifiable wrapper around currentIterators . |
Fields inherited from class it.unimi.di.mg4j.search.AbstractDocumentIterator |
---|
curr, weight |
Fields inherited from interface it.unimi.di.mg4j.search.DocumentIterator |
---|
END_OF_LIST |
Constructor Summary | |
---|---|
protected |
AbstractIntervalDocumentIterator(int n,
ReferenceSet<Index> indices,
boolean allIndexIterators,
Object arg)
Creates a new instance. |
Method Summary | |
---|---|
protected static boolean |
allIndexIterators(DocumentIterator... documentIterator)
A commodity static methods that checks whether all specified document iterators are actually index iterators. |
protected abstract IntervalIterator |
getIntervalIterator(Index index,
int n,
boolean allIndexIterators,
Object arg)
Creates an interval iterator suitable for this AbstractIntervalDocumentIterator . |
ReferenceSet<Index> |
indices()
Returns the set of indices over which this iterator is built. |
protected static ReferenceArraySet<Index> |
indices(Index index,
DocumentIterator... documentIterator)
A commodity static methods that computes the union of the indices of the given document iterators. |
Methods inherited from class it.unimi.di.mg4j.search.AbstractDocumentIterator |
---|
document, ensureOnADocument, mayHaveNext, weight, weight |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface it.unimi.di.mg4j.search.DocumentIterator |
---|
accept, acceptOnTruePaths, dispose, intervalIterator, intervalIterator, intervalIterators, nextDocument, skipTo |
Field Detail |
---|
protected final ReferenceSet<Index> indices
protected final Index soleIndex
null
, the sole index involved in this document iterator.
protected final IntervalIterator soleIntervalIterator
null
, the sole interval iterator involved in this document iterator.
protected final Index2IntervalIteratorMap intervalIterators
protected final Index2IntervalIteratorMap currentIterators
DocumentIterator.intervalIterators()
, leaving the
tracking of current iterators to some other mechanism.
protected final Reference2ReferenceMap<Index,IntervalIterator> unmodifiableCurrentIterators
currentIterators
.
Constructor Detail |
---|
protected AbstractIntervalDocumentIterator(int n, ReferenceSet<Index> indices, boolean allIndexIterators, Object arg)
n
- the number of underlying iterators.indices
- the set of indices appearing in the underlying iterators.allIndexIterators
- whether all underlying iterators are index iterators.arg
- an argument that will be passed to getIntervalIterator(Index, int, boolean, Object)
.Method Detail |
---|
protected abstract IntervalIterator getIntervalIterator(Index index, int n, boolean allIndexIterators, Object arg)
AbstractIntervalDocumentIterator
.
index
- the reference index for the iterator, or null
.n
- the number of underlying or component iterators.allIndexIterators
- whether all underlying or component iterators are index iterators.arg
- an optional argument.
AbstractIntervalDocumentIterator
.public ReferenceSet<Index> indices()
DocumentIterator
protected static ReferenceArraySet<Index> indices(Index index, DocumentIterator... documentIterator)
index
- an index that will be passed to AbstractCompositeDocumentIterator.AbstractCompositeDocumentIterator(Index, Object, DocumentIterator...)
.documentIterator
- a list of document iterators.
protected static boolean allIndexIterators(DocumentIterator... documentIterator)
documentIterator
- a list of document iterators.
documentIterator
are actually index iterators.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |