|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttimertests.TimerTests
class TimerTests
Field Summary | |
---|---|
protected java.util.ArrayList<stresstests.algorithms.ASortAlgo<stresstests.datasets.City>> |
algorithms
an ArrayList of algorithms to run |
protected java.util.Comparator<stresstests.datasets.City> |
byLatitude
compare cities by their latitude |
protected java.util.Comparator<stresstests.datasets.City> |
byName
compare cities by the name of the city |
protected java.util.Comparator<stresstests.datasets.City> |
byZip
compare cities by the zip code |
protected java.util.ArrayList<java.util.Comparator<stresstests.datasets.City>> |
comparators
create a list of all Comparator s |
protected java.util.ArrayList<java.lang.String> |
compNames
create a corresponding list of all Comparator names |
protected long |
endTime
the ending time for the sorting test |
protected long |
startTime
the starting time for the sorting test |
protected TestData |
testdata
The collection of data sets used in the tests |
Constructor Summary | |
---|---|
protected |
TimerTests()
The constructor only creates the three known Comparator s |
Method Summary | |
---|---|
protected void |
allAlgos(java.util.ArrayList<java.util.Comparator<stresstests.datasets.City>> comparators)
Add to the algorithms each of the known algorithm
with each of the given Comparator s |
protected java.util.ArrayList<Result> |
allTests()
Run the tests of all selected algorithms with all selected comparators on all selected datasets and save the results |
protected boolean |
isSorted(stresstests.interfaces.Traversal<stresstests.datasets.City> tr,
java.util.Comparator<stresstests.datasets.City> comp)
Is the data generated by the given traversal sorted by comparator? |
protected boolean |
isSortedAcc(stresstests.interfaces.Traversal<stresstests.datasets.City> tr,
java.util.Comparator<stresstests.datasets.City> comp,
stresstests.datasets.City acc)
Is the data generated by the given traversal sorted by comparator? and greater than or equal to the previous largest value? |
static void |
main(java.lang.String[] argv)
Self Test |
protected void |
makeAlgos(java.util.Comparator<stresstests.datasets.City> comp)
Add to the ArrayList of ASortAlgo s
each available algorithm with the given Comparator |
protected void |
makeComparators()
Construct the ArrayList of all available
Comparator s |
protected Result |
runATest(stresstests.algorithms.ASortAlgo<stresstests.datasets.City> algo,
DataSet<stresstests.datasets.City> dataset)
Run one test of a given sorting algorithm with the given comparator and the desired size of data, random or sequentially selected |
protected void |
sampleTest()
A sample test for this class |
protected java.util.ArrayList<java.lang.Integer> |
selectDataSets()
Produce a list of indices selecting the datasets to use in the sorting tests |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Comparator<stresstests.datasets.City> byName
protected java.util.Comparator<stresstests.datasets.City> byZip
protected java.util.Comparator<stresstests.datasets.City> byLatitude
protected java.util.ArrayList<java.util.Comparator<stresstests.datasets.City>> comparators
Comparator
s
protected java.util.ArrayList<java.lang.String> compNames
Comparator
names
protected java.util.ArrayList<stresstests.algorithms.ASortAlgo<stresstests.datasets.City>> algorithms
ArrayList
of algorithms to run
protected TestData testdata
protected long startTime
protected long endTime
Constructor Detail |
---|
protected TimerTests()
Comparator
s
Method Detail |
---|
protected void makeComparators()
ArrayList
of all available
Comparator
s
protected void makeAlgos(java.util.Comparator<stresstests.datasets.City> comp)
ArrayList
of ASortAlgo
s
each available algorithm with the given Comparator
comp
- the Comparator
used by these algorithmsprotected void allAlgos(java.util.ArrayList<java.util.Comparator<stresstests.datasets.City>> comparators)
algorithms
each of the known algorithm
with each of the given Comparator
s
comparators
- protected java.util.ArrayList<java.lang.Integer> selectDataSets()
protected java.util.ArrayList<Result> allTests()
ArrayList
of Result
dataprotected Result runATest(stresstests.algorithms.ASortAlgo<stresstests.datasets.City> algo, DataSet<stresstests.datasets.City> dataset)
algo
- the ASortAlgo
algorithm with the chosen
Comparator
dataset
- the data to be sorted
Result
reporting all
relevant dataprotected void sampleTest()
protected boolean isSorted(stresstests.interfaces.Traversal<stresstests.datasets.City> tr, java.util.Comparator<stresstests.datasets.City> comp)
tr
- the given Traversal
that generates the data
to be sortedcomp
- the Comparator
that determines the ordering
protected boolean isSortedAcc(stresstests.interfaces.Traversal<stresstests.datasets.City> tr, java.util.Comparator<stresstests.datasets.City> comp, stresstests.datasets.City acc)
tr
- the given Traversal
that generates the data
to be sortedcomp
- the Comparator
that determines the orderingacc
- the last value seen traversing over the data
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |