|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectstresstests.algorithms.ASortAlgo<T>
stresstests.algorithms.AListSortInsertion<T>
public class AListSortInsertion<T>
AListSortInsertion 22 March 2007 A class to represent insertion sort based on recursively defined list sorting algorithm
Field Summary | |
---|---|
java.util.ArrayList<T> |
result
the ArrayList to hold the result |
Traversal<T> |
tr
the Traversal that supplies the data to sort |
Fields inherited from class stresstests.algorithms.ASortAlgo |
---|
algoName, comp |
Constructor Summary | |
---|---|
AListSortInsertion(java.util.Comparator<T> comp)
|
|
AListSortInsertion(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 |
AList<T> |
insert(T city,
Traversal<T> tr)
Insert the given item into the given sorted list |
AList<T> |
insertionSort(Traversal<T> tr)
sort the data set with respect to the current Comparator |
static void |
main(java.lang.String[] argv)
|
AList<T> |
makeList(Traversal<T> tr)
Build the recursively defined list from the data generated by the given Traversal |
Traversal<T> |
sort()
wrapper for the sort method |
void |
testAListSortInsertion()
The tests for AListSortInsertion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Traversal<T> tr
Traversal
that supplies the data to sort
public java.util.ArrayList<T> result
ArrayList
to hold the result
Constructor Detail |
---|
public AListSortInsertion(java.util.Comparator<T> comp, Traversal<T> tr)
public AListSortInsertion(java.util.Comparator<T> comp)
Method Detail |
---|
public void initData(Traversal<T> tr)
Traversal
initData
in class ASortAlgo<T>
tr
- the Traversal
that provides the data to sortpublic Traversal<T> sort()
sort
in class ASortAlgo<T>
Traversal
for the sorted datapublic AList<T> insertionSort(Traversal<T> tr)
Comparator
tr
- the Traversal
for the input data
AList
for the sorted datapublic AList<T> insert(T city, Traversal<T> tr)
city
- the object of the type T
to inserttr
- the Traversal
for the sorted data
where to insert
Traversal
for the sorted data with the
given item insertedpublic AList<T> makeList(Traversal<T> tr)
Traversal
tr
- the given Traversal
AList
that contains the given datapublic void testAListSortInsertion()
AListSortInsertion
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |