All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jodd.util.sort.FastSort Maven / Gradle / Ivy

Go to download

Jodd Core tools and utilities, including type converters, JDateTime, cache etc.

There is a newer version: 5.3.0
Show newest version
// Copyright (c) 2003-2014, Jodd Team (jodd.org). All Rights Reserved.

package jodd.util.sort;

import java.util.Comparator;

/**
 * Fast sort.
 * 

* In JDK {@literal <} v7, implementation of merge sort (implemented in Arrays.sort) is * not the best one: there is redundant object array cloning, many small methods that * can be inlined etc. *

* This class brings the best sorting implementations, so they can be used on JDK5 and JDK6, too. */ public class FastSort { /** * Sorts an array using given comparator. */ public static void sort(T array[], Comparator comparator) { TimSort.sort(array, comparator); } /** * Sorts an array of comparables. */ public static void sort(Comparable array[]) { ComparableTimSort.sort(array); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy