|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectDriver
public class Driver
This class is the driver program for Homework 3 of CMP-338 in the Spring 2015 semester.
Nested Class Summary | |
---|---|
static class |
Driver.ListType
The ListType enum has the following choices:
ArrayBasedList
LinkedList
|
static class |
Driver.TestType
The TestType enum has the following choices:
AddSortedOdd
AddSortedEven
AddAll
AddAllAtIndexZero
RemoveAllEven
RemoveAllOdd
|
Constructor Summary | |
---|---|
Driver()
|
Method Summary | |
---|---|
static void |
clearRunTimes()
This method clears the array of run times to all zeros |
static ListInterface<java.lang.Integer> |
createTestList(Driver.TestType testType,
Driver.ListType listType)
This method is called by the runTestCase() method to obtain a test list. |
static long[] |
getRunTimes()
This method returns the array of run times that was generated by the previous call to runTestCase() |
static ListInterface<java.lang.Integer> |
initializeTestList(ListInterface<java.lang.Integer> testList,
int firstNumber,
int lastNumber,
int increment)
This method is called by the createTestList() method to initialize the test list. |
static void |
main(java.lang.String[] args)
The main method executes all the test cases. |
static void |
runTestCase(Driver.TestType testType,
Driver.ListType listType)
This method is called to run a particular test case on a list type a total of ten times. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Driver()
Method Detail |
---|
public static ListInterface<java.lang.Integer> initializeTestList(ListInterface<java.lang.Integer> testList, int firstNumber, int lastNumber, int increment)
testList
- The testList to be initialized.firstNumber
- The first number to be added to the list.lastNumber
- The last number to be added to the listincrement
- The increment to be used by the for loop for each iteration. If the increment is zero, the
test list is left empty.
public static ListInterface<java.lang.Integer> createTestList(Driver.TestType testType, Driver.ListType listType)
testType
- The type of test for which the list is being created. This parameter
determines how the test list is initialized. The initialization
takes place in initializeTestList()
.
listType
- The type of list needed. The choices are:
initializeTestList(ListInterface, int, int, int)
public static void runTestCase(Driver.TestType testType, Driver.ListType listType)
testType
- The type of test case being run. The choices are:
listType
- The type of list needed. The choices are:
public static long[] getRunTimes()
runTestCase()
public static void clearRunTimes()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |