Class SortingUtil


  • public class SortingUtil
    extends Object
    Author:
    Eugene Petrenko Created: 14.11.2008 18:04:55
    • Constructor Detail

      • SortingUtil

        public SortingUtil()
    • Method Detail

      • sort

        @NotNull
        public static <Q> SortingUtil.Permutation sort​(@NotNull
                                                       List<Q> list,
                                                       @NotNull
                                                       Comparator<Q> cmp)
        Sorts collection from list according to comparer cmp and returns permutation object which can be applied to re-sort any other list of the same size.
        Type Parameters:
        Q -
        Parameters:
        list -
        cmp -
        Returns:
        sorts list from argument, and returns sorting permutation for that