com.tivoli.twg.libs
Class MergeSort

java.lang.Object
  extended bycom.tivoli.twg.libs.MergeSort

public class MergeSort
extends java.lang.Object

Merge sort implementation for various Java data primitives


Constructor Summary
MergeSort()
           
 
Method Summary
static void main(java.lang.String[] s)
           
static void sort(double[] array, int start_index, int count)
          Do merge sort on range of values in a given double array.
static void sort(double[] array, int start_index, java.lang.Object[] objset, int obj_index, int count)
          Do merge sort on range of values in a given double array.
static void sort(float[] array, int start_index, int count)
          Do merge sort on range of values in a given float array.
static void sort(float[] array, int start_index, java.lang.Object[] objset, int obj_index, int count)
          Do merge sort on range of values in a given float array.
static void sort(int[] array, int start_index, int count)
          Do merge sort on range of values in a given int array.
static void sort(int[] array, int start_index, java.lang.Object[] objset, int obj_index, int count)
          Do merge sort on range of values in a given int array.
static void sort(long[] array, int start_index, int count)
          Do merge sort on range of values in a given long array.
static void sort(long[] array, int start_index, java.lang.Object[] objset, int obj_index, int count)
          Do merge sort on range of values in a given long array.
static void sort(java.lang.Object[] array, int start_index, java.lang.Object[] objset, int obj_index, int count, ObjectComparator rsi)
          Do merge sort on range of values in a given String array, using a given collator for sorting.
static void sort(short[] array, int start_index, int count)
          Do merge sort on range of values in a given short array.
static void sort(short[] array, int start_index, java.lang.Object[] objset, int obj_index, int count)
          Do merge sort on range of values in a given short array.
static void sort(java.lang.String[] array, int start_index, int count)
          Do merge sort on range of values in a given String array, using a lexigraphical sort (non-locale specific).
static void sort(java.lang.String[] array, int start_index, java.lang.Object[] objset, int obj_index, java.text.CollationKey[] colkeyset, int col_index, int count)
          Do merge sort on range of values in a given String array, using a given collator for sorting.
static void sort(java.lang.String[] array, int start_index, java.lang.Object[] objset, int obj_index, int count)
          Do merge sort on range of values in a given String array, using a lexigraphical sort (non-locale specific).
static void sort(java.lang.String[] array, int start_index, java.lang.Object[] objset, int obj_index, int count, java.text.Collator col)
          Do merge sort on range of values in a given String array, using a given collator for sorting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeSort

public MergeSort()
Method Detail

sort

public static void sort(java.lang.String[] array,
                        int start_index,
                        int count)
Do merge sort on range of values in a given String array, using a lexigraphical sort (non-locale specific).

Parameters:
array - - array of values
start_index - - index of first value to sort
count - - number of elements to sort

sort

public static void sort(java.lang.String[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count)
Do merge sort on range of values in a given String array, using a lexigraphical sort (non-locale specific). Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort

sort

public static void sort(java.lang.String[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count,
                        java.text.Collator col)
Do merge sort on range of values in a given String array, using a given collator for sorting. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort
col - - collator to use for comparisons

sort

public static void sort(java.lang.String[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        java.text.CollationKey[] colkeyset,
                        int col_index,
                        int count)
Do merge sort on range of values in a given String array, using a given collator for sorting. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
colkeyset - - array of collation keys for values in 'array'
col_index - - start index of first value in colkeyset
count - - number of elements to sort

sort

public static void sort(long[] array,
                        int start_index,
                        int count)
Do merge sort on range of values in a given long array.

Parameters:
array - - array of values
start_index - - index of first value to sort
count - - number of elements to sort

sort

public static void sort(long[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count)
Do merge sort on range of values in a given long array. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort

sort

public static void sort(int[] array,
                        int start_index,
                        int count)
Do merge sort on range of values in a given int array.

Parameters:
array - - array of values
start_index - - index of first value to sort
count - - number of elements to sort

sort

public static void sort(int[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count)
Do merge sort on range of values in a given int array. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort

sort

public static void sort(short[] array,
                        int start_index,
                        int count)
Do merge sort on range of values in a given short array.

Parameters:
array - - array of values
start_index - - index of first value to sort
count - - number of elements to sort

sort

public static void sort(short[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count)
Do merge sort on range of values in a given short array. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort

sort

public static void sort(float[] array,
                        int start_index,
                        int count)
Do merge sort on range of values in a given float array.

Parameters:
array - - array of values
start_index - - index of first value to sort
count - - number of elements to sort

sort

public static void sort(float[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count)
Do merge sort on range of values in a given float array. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort

sort

public static void sort(double[] array,
                        int start_index,
                        int count)
Do merge sort on range of values in a given double array.

Parameters:
array - - array of values
start_index - - index of first value to sort
count - - number of elements to sort

sort

public static void sort(double[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count)
Do merge sort on range of values in a given double array. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort

sort

public static void sort(java.lang.Object[] array,
                        int start_index,
                        java.lang.Object[] objset,
                        int obj_index,
                        int count,
                        ObjectComparator rsi)
Do merge sort on range of values in a given String array, using a given collator for sorting. Sort object set to maintain matching indexes with sorted data.

Parameters:
array - - array of values to be sorted
start_index - - index of first value to sort
objset - - array of objects keyed by values
obj_index - - start index of first object keyed by values
count - - number of elements to sort

main

public static void main(java.lang.String[] s)