Package org.apache.lucene.util
Class Selector
- java.lang.Object
-
- org.apache.lucene.util.Selector
-
- Direct Known Subclasses:
IntroSelector,RadixSelector
public abstract class Selector extends java.lang.ObjectAn implementation of a selection algorithm, ie. computing the k-th greatest value from a collection.
-
-
Constructor Summary
Constructors Constructor Description Selector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) voidcheckArgs(int from, int to, int k)abstract voidselect(int from, int to, int k)Reorder elements so that the element at positionkis the same as if all elements were sorted and all other elements are partitioned around it:[from, k)only contains elements that are less than or equal tokand(k, to)only contains elements that are greater than or equal tok.protected abstract voidswap(int i, int j)Swap values at slotsiandj.
-
-
-
Method Detail
-
select
public abstract void select(int from, int to, int k)Reorder elements so that the element at positionkis the same as if all elements were sorted and all other elements are partitioned around it:[from, k)only contains elements that are less than or equal tokand(k, to)only contains elements that are greater than or equal tok.
-
checkArgs
void checkArgs(int from, int to, int k)
-
swap
protected abstract void swap(int i, int j)Swap values at slotsiandj.
-
-