stresstests.algorithms
Class ArrSortSelection<T>

java.lang.Object
  extended by stresstests.algorithms.ASortAlgo<T>
      extended by stresstests.algorithms.ArrSortSelection<T>

public class ArrSortSelection<T>
extends ASortAlgo<T>

ArrSortSelection 22 March 2007 A class to represent one sorting algorithm

Author:
Viera K. Proulx

Field Summary
 java.util.ArrayList<T> data
           
 
Fields inherited from class stresstests.algorithms.ASortAlgo
algoName, comp
 
Constructor Summary
ArrSortSelection(java.util.Comparator<T> comp)
           
ArrSortSelection(java.util.Comparator<T> comp, Traversal<T> tr)
           
 
Method Summary
 int findMinIndex(int low)
           
 void initData(Traversal<T> tr)
          Initialize the internal data set with the data generated by the Traversal
static void main(java.lang.String[] argv)
           
 Traversal<T> sort()
          sort the data set with respect to the current Comparator
 void swap(int index1, int index2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

public java.util.ArrayList<T> data
Constructor Detail

ArrSortSelection

public ArrSortSelection(java.util.Comparator<T> comp,
                        Traversal<T> tr)

ArrSortSelection

public ArrSortSelection(java.util.Comparator<T> comp)
Method Detail

initData

public void initData(Traversal<T> tr)
Initialize the internal data set with the data generated by the Traversal

Specified by:
initData in class ASortAlgo<T>
Parameters:
tr - the Traversal that provides the data to sort

sort

public Traversal<T> sort()
sort the data set with respect to the current Comparator

Specified by:
sort in class ASortAlgo<T>
Returns:
a AList for the sorted data

swap

public void swap(int index1,
                 int index2)

findMinIndex

public int findMinIndex(int low)

main

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