Package org.h2.index

# Class IndexSort

java.lang.Object
org.h2.index.IndexSort

All Implemented Interfaces:
  `Comparable<IndexSort>`

public final class IndexSort extends Object implements Comparable<IndexSort>
Index-sorting information.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`FULLY_SORTED`
Used instead of actual number of sorted columns when post-sorting isn't needed.

## Constructor Summary

Constructors
Constructor
Description
`IndexSort(Index index, boolean reverse)`
Creates an index sorting information for complete index sort.
`IndexSort(Index index, int sortedColumns, boolean reverse)`
Creates an index sorting information for index sort.

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(IndexSort o)`
`Index`
`getIndex()`
Returns the index.
`int`
`getSortedColumns()`
Returns number of sorted columns.
`boolean`
`isReverse()`
Returns whether index must be iterated in reverse order.

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

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

## Field Details

### FULLY_SORTED

public static final int FULLY_SORTED
Used instead of actual number of sorted columns when post-sorting isn't needed.

See Also:
  - Constant Field Values

## Constructor Details

### IndexSort

public IndexSort(Index index, boolean reverse)
Creates an index sorting information for complete index sort.

Parameters:
  `index` - the index
  `reverse` - whether index must be iterated in reverse order

### IndexSort

public IndexSort(Index index, int sortedColumns, boolean reverse)
Creates an index sorting information for index sort.

Parameters:
  `index` - the index
  `sortedColumns` - a positive number of sorted columns for partial index sorts, or `FULLY_SORTED` for complete index sorts
  `reverse` - whether index must be iterated in reverse order

## Method Details

### getIndex

public Index getIndex()
Returns the index.

Returns:
  the index

### getSortedColumns

public int getSortedColumns()
Returns number of sorted columns.

Returns:
  positive number of sorted columns for partial index sorts, or `FULLY_SORTED` for complete index sorts

### isReverse

public boolean isReverse()
Returns whether index must be iterated in reverse order.

Returns:
  `true` for reverse order, `false` for natural order

### compareTo

public int compareTo(IndexSort o)

Specified by:
  `compareTo` in interface `Comparable<IndexSort>`