Top Description Fields Constructors Methods
org.h2.index

public final Class IndexSort

extends Object
implements Comparable<IndexSort>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable

Index-sorting information.

Field Summary

Modifier and TypeField and Description
public static final int
FULLY_SORTED

Used instead of actual number of sorted columns when post-sorting isn't needed.

private final Index
private final boolean
reverse

Whether index must be iterated in reverse order.

private final int
sortedColumns

A positive number of sorted columns for partial index sorts, or FULLY_SORTED for complete index sorts.

Constructor Summary

AccessConstructor and Description
public
IndexSort(Index
the index
index
,
boolean
whether index must be iterated in reverse order
reverse
)

Creates an index sorting information for complete index sort.

public
IndexSort(Index
the index
index
,
int
a positive number of sorted columns for partial index sorts, or FULLY_SORTED for complete index sorts
sortedColumns
,
boolean
whether index must be iterated in reverse order
reverse
)

Creates an index sorting information for index sort.

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(IndexSort
the object to be compared.
o
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public Index

Returns:

the index
getIndex
()

Returns the index.

public int

Returns:

positive number of sorted columns for partial index sorts, or FULLY_SORTED for complete index sorts
getSortedColumns
()

Returns number of sorted columns.

public boolean

Returns:

true for reverse order, false for natural order
isReverse
()

Returns whether index must be iterated in reverse order.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

FULLY_SORTEDback to summary
public static final int FULLY_SORTED

Used instead of actual number of sorted columns when post-sorting isn't needed.

indexback to summary
private final Index index
reverseback to summary
private final boolean reverse

Whether index must be iterated in reverse order.

sortedColumnsback to summary
private final int sortedColumns

A positive number of sorted columns for partial index sorts, or FULLY_SORTED for complete index sorts.

Constructor Detail

IndexSortback to summary
public IndexSort(Index index, boolean reverse)

Creates an index sorting information for complete index sort.

Parameters
index:Index

the index

reverse:boolean

whether index must be iterated in reverse order

IndexSortback to summary
public IndexSort(Index index, int sortedColumns, boolean reverse)

Creates an index sorting information for index sort.

Parameters
index:Index

the index

sortedColumns:int

a positive number of sorted columns for partial index sorts, or FULLY_SORTED for complete index sorts

reverse:boolean

whether index must be iterated in reverse order

Method Detail

compareToback to summary
public int compareTo(IndexSort o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
o:IndexSort

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
getIndexback to summary
public Index getIndex()

Returns the index.

Returns:Index

the index

getSortedColumnsback to summary
public int getSortedColumns()

Returns number of sorted columns.

Returns:int

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

isReverseback to summary
public boolean isReverse()

Returns whether index must be iterated in reverse order.

Returns:boolean

true for reverse order, false for natural order