Module org.apache.lucene.core
Package org.apache.lucene.index
Class FreqProxTermsWriter.SortingPostingsEnum.DocOffsetSorter
java.lang.Object
org.apache.lucene.util.Sorter
org.apache.lucene.util.TimSorter
org.apache.lucene.index.FreqProxTermsWriter.SortingPostingsEnum.DocOffsetSorter
- Enclosing class:
FreqProxTermsWriter.SortingPostingsEnum
private static final class FreqProxTermsWriter.SortingPostingsEnum.DocOffsetSorter
extends TimSorter
A
TimSorter which sorts two parallel arrays of doc IDs and offsets in one go. Everyti
me a doc ID is 'swapped', its corresponding offset is swapped too.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]private long[]private int[]private long[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompare(int i, int j) Compare entries found in slotsiandj.protected intcompareSaved(int i, int j) Compare elementifrom the temporary storage with elementjfrom the slice to sort, similarly toSorter.compare(int, int).protected voidcopy(int src, int dest) Copy data from slotsrcto slotdest.voidreset(int[] docs, long[] offsets) protected voidrestore(int i, int j) Restore elementjfrom the temporary storage into sloti.protected voidsave(int i, int len) Save all elements between slotsiandi+leninto the temporary storage.protected voidswap(int i, int j) Swap values at slotsiandj.Methods inherited from class org.apache.lucene.util.Sorter
comparePivot, setPivot
-
Field Details
-
docs
private int[] docs -
offsets
private long[] offsets -
tmpDocs
private int[] tmpDocs -
tmpOffsets
private long[] tmpOffsets
-
-
Constructor Details
-
DocOffsetSorter
public DocOffsetSorter(int numTempSlots)
-
-
Method Details
-
reset
public void reset(int[] docs, long[] offsets) -
compare
protected int compare(int i, int j) Description copied from class:SorterCompare entries found in slotsiandj. The contract for the returned value is the same asComparator.compare(Object, Object). -
swap
protected void swap(int i, int j) Description copied from class:SorterSwap values at slotsiandj. -
copy
protected void copy(int src, int dest) Description copied from class:TimSorterCopy data from slotsrcto slotdest. -
save
protected void save(int i, int len) Description copied from class:TimSorterSave all elements between slotsiandi+leninto the temporary storage. -
restore
protected void restore(int i, int j) Description copied from class:TimSorterRestore elementjfrom the temporary storage into sloti. -
compareSaved
protected int compareSaved(int i, int j) Description copied from class:TimSorterCompare elementifrom the temporary storage with elementjfrom the slice to sort, similarly toSorter.compare(int, int).- Specified by:
compareSavedin classTimSorter
-