Class CollectionUtil.ListTimSorter<T>

    • Field Detail

      • list

        final java.util.List<T> list
      • comp

        final java.util.Comparator<? super T> comp
      • tmp

        final T[] tmp
    • Constructor Detail

      • ListTimSorter

        ListTimSorter​(java.util.List<T> list,
                      java.util.Comparator<? super T> comp,
                      int maxTempSlots)
    • Method Detail

      • swap

        protected void swap​(int i,
                            int j)
        Description copied from class: Sorter
        Swap values at slots i and j.
        Specified by:
        swap in class Sorter
      • copy

        protected void copy​(int src,
                            int dest)
        Description copied from class: TimSorter
        Copy data from slot src to slot dest.
        Specified by:
        copy in class TimSorter
      • save

        protected void save​(int i,
                            int len)
        Description copied from class: TimSorter
        Save all elements between slots i and i+len into the temporary storage.
        Specified by:
        save in class TimSorter
      • restore

        protected void restore​(int i,
                               int j)
        Description copied from class: TimSorter
        Restore element j from the temporary storage into slot i.
        Specified by:
        restore in class TimSorter
      • compare

        protected int compare​(int i,
                              int j)
        Description copied from class: Sorter
        Compare entries found in slots i and j. The contract for the returned value is the same as Comparator.compare(Object, Object).
        Specified by:
        compare in class Sorter
      • compareSaved

        protected int compareSaved​(int i,
                                   int j)
        Description copied from class: TimSorter
        Compare element i from the temporary storage with element j from the slice to sort, similarly to Sorter.compare(int, int).
        Specified by:
        compareSaved in class TimSorter