Package gnu.kawa.util

Class HeapSort.IndexSort

  • Enclosing class:
    HeapSort<T,​C>

    public abstract static class HeapSort.IndexSort
    extends HeapSort<int[],​java.lang.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 Summary

      Constructors 
      Constructor Description
      IndexSort()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected int compare​(int[] a, int i, int j, java.lang.Object comparator)  
      protected abstract int compare​(java.lang.Object x, java.lang.Object y)  
      protected abstract java.lang.Object lookup​(java.lang.Object comparator, int i)  
      protected void swap​(int[] a, int i, int j)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IndexSort

        public IndexSort()
    • Method Detail

      • swap

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

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

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

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