org.relayirc.util
Class QuickSort

java.lang.Object
  |
  +--org.relayirc.util.QuickSort

public class QuickSort
extends java.lang.Object

Quick sort implementation that will sort an array or Vector of IComparable objects.

See Also:
IComparable, Vector

Constructor Summary
QuickSort()
           
 
Method Summary
static boolean needsSorting(java.util.Vector v)
          Quicksort will rearrange elements when they are all equal.
static void quicksort(IComparable[] arr, boolean ascending)
           
static void quicksort(java.util.Vector v, boolean ascending)
           
 
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

needsSorting

public static boolean needsSorting(java.util.Vector v)
Quicksort will rearrange elements when they are all equal. Make sure at least two elements differ

quicksort

public static void quicksort(IComparable[] arr,
                             boolean ascending)

quicksort

public static void quicksort(java.util.Vector v,
                             boolean ascending)