IndexedSortable (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.util, interface: IndexedSortable

Package org.apache.hadoop.util

# Interface IndexedSortable

@LimitedPrivate("MapReduce") @Unstable public interface IndexedSortable
Interface for collections capable of being sorted by `IndexedSorter` algorithms.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compare(int i, int j)`
  Compare items at the given addresses consistent with the semantics of `Comparator.compare(Object, Object)`.
  `void`
  `swap(int i, int j)`
  Swap items at the given addresses.

- ## Method Details

  - ### compare

    int compare(int i, int j)
    Compare items at the given addresses consistent with the semantics of `Comparator.compare(Object, Object)`.
    Parameters:
      `i` - (int).
      `j` - (int).
    Returns:
      compare result.

  - ### swap

    void swap(int i, int j)
    Swap items at the given addresses.
    Parameters:
      `i` - i(int).
      `j` - j(int).