public class TrianaSort
extends java.lang.Object
Constructor and Description |
---|
TrianaSort() |
Modifier and Type | Method and Description |
---|---|
static double[] |
mergeSort(double[] input)
Sort the given numbers into ascending order.
|
static double[] |
mergeSort(double[] input,
double direction)
Sort the given numbers into ascending order if the direction argument is non-negative, descending order
otherwise.
|
static java.util.Vector<java.lang.String> |
mergeSort(java.util.Enumeration e)
Sort the Strings held in the list referred to by the input Enumeration lexically in ascending order.
|
static java.util.Vector<java.lang.String> |
mergeSort(java.util.Enumeration<java.lang.String> e,
double direction)
Sort the Strings held in the list referred to by the input Enumeration lexically in ascending order if the
direction argument is non-negative, descending order otherwise.
|
static java.lang.String[] |
mergeSort(java.lang.String[] input)
Sort the given Strings lexically in ascending order.
|
static java.lang.String[] |
mergeSort(java.lang.String[] input,
double direction)
Sort the given Strings lexically in ascending order if the direction argument is non-negative, descending
order otherwise.
|
static java.util.Vector<java.lang.String> |
mergeSort(java.util.Vector<java.lang.String> input)
Sort the Strings held in the input StringVector lexically in ascending order.
|
static java.util.Vector<java.lang.String> |
mergeSort(java.util.Vector<java.lang.String> input,
double direction)
Sort the Strings held in the input StringVector lexically in ascending order if the direction argument is
non-negative, descending order otherwise.
|
static java.lang.String[] |
sortToolboxes(java.lang.String[] s)
Sorts the tools into alphabetical order but makes sure that the Demos toolbox is at the front and that the Common
toolbox is appropriately placed.
|
public static double[] mergeSort(double[] input, double direction)
input
- The input numbers to be sorteddirection
- If non-negative, sort will be ascendingpublic static double[] mergeSort(double[] input)
input
- The input numbers to be sortedpublic static java.lang.String[] mergeSort(java.lang.String[] input, double direction)
input
- The array of input Strings to be sorteddirection
- If non-negative, sort will be ascendingpublic static java.lang.String[] mergeSort(java.lang.String[] input)
input
- The array of input Strings to be sortedpublic static java.util.Vector<java.lang.String> mergeSort(java.util.Vector<java.lang.String> input, double direction)
input
- The list of input Strings to be sorteddirection
- If non-negative, sort will be ascendingpublic static java.util.Vector<java.lang.String> mergeSort(java.util.Vector<java.lang.String> input)
input
- The list of input Strings to be sortedpublic static java.util.Vector<java.lang.String> mergeSort(java.util.Enumeration<java.lang.String> e, double direction)
e
- The Enumeration of the list of input Strings to be sorteddirection
- If non-negative, sort will be ascendingpublic static java.util.Vector<java.lang.String> mergeSort(java.util.Enumeration e)
e
- The Enumeration of the list of input Strings to be sortedpublic static java.lang.String[] sortToolboxes(java.lang.String[] s)
s
- The input array of Strings containing the toolbox names