Package org.apache.lucene.index
Class Sorter.DocMap
java.lang.Object
org.apache.lucene.index.Sorter.DocMap
- Enclosing class:
Sorter
A permutation of doc IDs. For every document ID between
0
and IndexReader.maxDoc()
, oldToNew(newToOld(docID))
must return docID
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
newToOld
(int docID) Given the ordinal of a doc ID, return its doc ID in the original index.abstract int
oldToNew
(int docID) Given a doc ID from the original index, return its ordinal in the sorted index.abstract int
size()
Return the number of documents in this map.
-
Constructor Details
-
DocMap
protected DocMap()Sole constructor.
-
-
Method Details
-
oldToNew
public abstract int oldToNew(int docID) Given a doc ID from the original index, return its ordinal in the sorted index. -
newToOld
public abstract int newToOld(int docID) Given the ordinal of a doc ID, return its doc ID in the original index. -
size
public abstract int size()Return the number of documents in this map. This must be equal to thenumber of documents
of theLeafReader
which is sorted.
-