InPlaceMergeSorter (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.util, class: InPlaceMergeSorter

Package org.apache.lucene.util

# Class InPlaceMergeSorter

java.lang.Object
org.apache.lucene.util.Sorter
org.apache.lucene.util.InPlaceMergeSorter

public abstract class InPlaceMergeSorter extends Sorter
`Sorter` implementation based on the merge-sort algorithm that merges in place (no extra memory will be allocated). Small arrays are sorted with binary sort.

This algorithm is stable. It's especially suited to sorting small lists where we'd rather optimize for avoiding allocating memory for this task. It performs well on lists that are already sorted.

NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InPlaceMergeSorter()`
  Create a new `InPlaceMergeSorter`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `sort(int from, int to)`
  Sort the slice which starts at `from` (inclusive) and ends at `to` (exclusive).

  ### Methods inherited from class org.apache.lucene.util.Sorter

  `compare, comparePivot, setPivot, swap`

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

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

- ## Constructor Details

  - ### InPlaceMergeSorter

    public InPlaceMergeSorter()
    Create a new `InPlaceMergeSorter`

- ## Method Details

  - ### sort

    public final void sort(int from, int to)
    Description copied from class: `Sorter`
    Sort the slice which starts at `from` (inclusive) and ends at `to` (exclusive).
    Specified by:
      `sort` in class `Sorter`