stresstests.algorithms
Class ArrSortInsertion<T>

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

public class ArrSortInsertion<T>
extends ASortAlgo<T>

ArrSortInsertion 22 March 2007 A class to represent one sorting algorithm

Author:
Viera K. Proulx

Field Summary
 java.util.ArrayList<T> data
          data that will be sorted -- mutating sort
 
Fields inherited from class stresstests.algorithms.ASortAlgo
algoName, comp
 
Constructor Summary
ArrSortInsertion(java.util.Comparator<T> comp)
           
ArrSortInsertion(java.util.Comparator<T> comp, Traversal<T> tr)
           
 
Method Summary
 void initData(Traversal<T> tr)
          Initialize the internal data set with the data generated by the Traversal
 void insert(int index)
           
 void insertionSortArr()
           
static void main(java.lang.String[] argv)
           
 Traversal<T> sort()
          sort the data set with respect to the current Comparator
 
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
data that will be sorted -- mutating sort

Constructor Detail

ArrSortInsertion

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

ArrSortInsertion

public ArrSortInsertion(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

insertionSortArr

public void insertionSortArr()

insert

public void insert(int index)

main

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