public class Sort
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
private |
Sort()
This class is supposed to have static methods only.
|
Modifier and Type | Method and Description |
---|---|
static void |
sort(java.lang.Object[] a,
ComparatorInterface comparator)
Sort the complete argument array according to the argument comparator.
|
static void |
sort(java.lang.Object[] a,
int from,
int to,
ComparatorInterface c)
Sorts some (or all) elements of an Object array according to a specified comparator.
|
private Sort()
public static void sort(java.lang.Object[] a, int from, int to, ComparatorInterface c)
As for the implementation of this method, it is taken from Arrays.java as found in Classpath 0.0.2 (2001-01-06). Go to www.classpath.org to learn more about the project, which implements the Java core libraries under the GPL.
a
- the array which is to be sortedfrom
- the index value of the first element of the interval to be sortedto
- the index value of the last element of the interval to be sortedc
- the comparator used to query the relation between two objectspublic static void sort(java.lang.Object[] a, ComparatorInterface comparator)
sort(a, 0, a.length - 1, comparator);
a
- array to be sortedcomparator
- the comparator used to compare to array entries