stresstests.algorithms
Class ASortAlgo<T>

java.lang.Object
  extended by stresstests.algorithms.ASortAlgo<T>
Direct Known Subclasses:
AListSortInsertion, AListSortQuickSort, ArrSortInsertion, ArrSortQuick, ArrSortSelection

public abstract class ASortAlgo<T>
extends java.lang.Object

ASortAlgo 22 March 2007 An interface to represent one sorting algorithm

Author:
Viera K. Proulx

Field Summary
 java.lang.String algoName
          The name of the sorting algorithm being tested
 java.util.Comparator<T> comp
          The Comparator that determines the sort order
 
Constructor Summary
ASortAlgo()
           
 
Method Summary
abstract  void initData(Traversal<T> tr)
          initialize a data set with the data generated by the traversal
abstract  Traversal<T> sort()
          sort the data set with respect to the given Comparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comp

public java.util.Comparator<T> comp
The Comparator that determines the sort order


algoName

public java.lang.String algoName
The name of the sorting algorithm being tested

Constructor Detail

ASortAlgo

public ASortAlgo()
Method Detail

initData

public abstract void initData(Traversal<T> tr)
initialize a data set with the data generated by the traversal

Parameters:
tr - the Traversal that generates the data to be sorted

sort

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

Returns:
a traversal for the sorted data