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 Object
An implementation of a selection algorithm, ie. computing the k-th greatest value from a collection.

## Constructor Summary

Constructors
Constructor
Description
`Selector()`

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`select(int from, int to, int k)`
Reorder elements so that the element at position `k` is 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 to `k` and `(k, to)` only contains elements that are greater than or equal to `k`.
`protected abstract void`
`swap(int i, int j)`
Swap values at slots `i` and `j`.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### Selector

public Selector()

## Method Details

### select

public abstract void select(int from, int to, int k)
Reorder elements so that the element at position `k` is 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 to `k` and `(k, to)` only contains elements that are greater than or equal to `k`.

### swap

protected abstract void swap(int i, int j)
Swap values at slots `i` and `j`.