com.partnersoft.data
Class ArrayQuickSort

java.lang.Object
  extended by com.partnersoft.data.ArrayQuickSort
All Implemented Interfaces:
ArraySortingAlgorithm

public class ArrayQuickSort
extends java.lang.Object
implements ArraySortingAlgorithm

A generic quicksort. Based on chapter 9 of Algorithms, by Robert Sedgewick, 1988 ISBN 0-201-06673-4. Uses pluggable ArraySortingGophers to allow sorting of any list of data.

Author:
Paul Reavis Copyright 2000 Partner Software, Inc.

Constructor Summary
ArrayQuickSort()
           
 
Method Summary
static ArrayQuickSort singleton()
           
 void sort(ArraySortingGopher gopher)
          Just do it.
 void sort(ArraySortingGopher gopher, int start, int end)
          Does the job using the given gopher over the given range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayQuickSort

public ArrayQuickSort()
Method Detail

singleton

public static ArrayQuickSort singleton()

sort

public final void sort(ArraySortingGopher gopher)
Just do it.

Specified by:
sort in interface ArraySortingAlgorithm

sort

public final void sort(ArraySortingGopher gopher,
                       int start,
                       int end)
Description copied from interface: ArraySortingAlgorithm
Does the job using the given gopher over the given range.

Specified by:
sort in interface ArraySortingAlgorithm