Package gnu.kawa.util

Class HeapSort.IndexSort

  • Enclosing class:
    HeapSort<T,​C>

    public abstract static class HeapSort.IndexSort
    extends HeapSort<int[],​Object>
    Sort an error of integer indexes based on a lookup object. Could be used to implement APL "grade up": Initialize the array to [0 ... count-1], and override lookup to index in the soyrce.
    • Constructor Detail

      • IndexSort

        public IndexSort()
    • Method Detail

      • swap

        protected void swap​(int[] a,
                            int i,
                            int j)
        Specified by:
        swap in class HeapSort<int[],​Object>
      • lookup

        protected abstract Object lookup​(Object comparator,
                                         int i)
      • compare

        protected abstract int compare​(Object x,
                                       Object y)
      • compare

        protected int compare​(int[] a,
                              int i,
                              int j,
                              Object comparator)
        Specified by:
        compare in class HeapSort<int[],​Object>