com.tffenterprises.util
Class StringMergeSort

java.lang.Object
  extended by com.tffenterprises.util.AbstractMergeSort
      extended by com.tffenterprises.util.StringMergeSort

public class StringMergeSort
extends AbstractMergeSort

An implementation of the merge sort for Strings.

Version:
1.0d1 $Date: 2001/11/24 05:07:47 $
Author:
Daniel M. Zimmerman

Field Summary
 
Fields inherited from class com.tffenterprises.util.AbstractMergeSort
arrayToSort, scratch
 
Constructor Summary
StringMergeSort()
           
 
Method Summary
protected  int compareElementsAt(int firstIndex, int secondIndex)
          Compares two strings at specified indices of the array.
 
Methods inherited from class com.tffenterprises.util.AbstractMergeSort
merge, mergeSort, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringMergeSort

public StringMergeSort()
Method Detail

compareElementsAt

protected int compareElementsAt(int firstIndex,
                                int secondIndex)
Compares two strings at specified indices of the array.

Specified by:
compareElementsAt in class AbstractMergeSort
Parameters:
firstIndex - The index of the first string to compare.
secondIndex - The index of the second string to compare.
Returns:
a negative integer if the string at firstIndex is less than the string at secondIndex, a positive integer if the string at firstIndex is greater than the string at secondIndex, and 0 if the two strings are equal.