Class RemappingDocumentIterator

  • All Implemented Interfaces:
    DocumentIterator

    public class RemappingDocumentIterator
    extends Object
    implements DocumentIterator
    A decorator that remaps interval iterator requests.

    Sometimes it is necessary to combine with positional operators (e.g., ConsecutiveDocumentIterator) intervals from different indices. By wrapping with an instance of this class a DocumentIterator, the requests for intervals will be remapped following a map given at construction time.

    This class distinguishes between internal indices, which are those actually provided by the underlying DocumentIterator, and external indices, which are those exposed by indices(), and with which intervalIterator(Index) should be called. The map provided at construction time should remap external indices to internal indices (note the inversion w.r.t. Remap). In many cases, a singleton map will be appropriate.

    Since:
    2.2
    Author:
    Sebastiano Vigna