com.ibm.commons.util
Class QuickSort

java.lang.Object
  extended by com.ibm.commons.util.QuickSort
Direct Known Subclasses:
QuickSort.IntArray, QuickSort.JavaList, QuickSort.JavaVector, QuickSort.ObjectArray, QuickSort.StringArray

public abstract class QuickSort
extends java.lang.Object

Easy to use QuickSort set of classes for sorting data.

The QuickSort class is an abstract class that requires some of its methods to be overridden to give actual access to the collection.


Nested Class Summary
static class QuickSort.IntArray
          Quicksort class used to sort an array of integers.
static class QuickSort.JavaList
          Quicksort class used to sort a Java List.
static class QuickSort.JavaVector
          Quicksort class used to sort a Java Vector.
static class QuickSort.ObjectArray
          Quicksort class used to sort an array of objects.
static class QuickSort.StringArray
          Quicksort class used to sort an array of Strings.
 
Constructor Summary
QuickSort()
           
 
Method Summary
abstract  int compare(int idx1, int idx2)
          Compare 2 elements in the collection, based on their index.
abstract  void exchange(int idx1, int idx2)
          Exchange 2 elements in the collection, based on their index.
abstract  int getCount()
          Returns the number of elements in the collection.
 void sort()
          Sort the entire collection.
 void sort(int first, int length)
          Sort a subpart of the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuickSort

public QuickSort()
Method Detail

sort

public void sort()
Sort the entire collection.


sort

public void sort(int first,
                 int length)
Sort a subpart of the collection.


getCount

public abstract int getCount()
Returns the number of elements in the collection.


compare

public abstract int compare(int idx1,
                            int idx2)
Compare 2 elements in the collection, based on their index.


exchange

public abstract void exchange(int idx1,
                              int idx2)
Exchange 2 elements in the collection, based on their index.