Package org.h2.index

Class IndexSort

  • All Implemented Interfaces:
    java.lang.Comparable<IndexSort>

    public final class IndexSort
    extends java.lang.Object
    implements java.lang.Comparable<IndexSort>
    Index-sorting information.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static 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.
    • Field Detail

      • 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 Detail

      • 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 Detail

      • 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 java.lang.Comparable<IndexSort>