public class Driver extends java.lang.Object implements DriverInterface
DriverInterface.ListType, DriverInterface.TestType
Constructor and Description |
---|
Driver() |
Modifier and Type | Method and Description |
---|---|
ListInterface<java.lang.Integer> |
createList(DriverInterface.ListType listType,
DriverInterface.TestType forTestType)
This method is used to create a new list of the specified listType.
|
ListInterface<java.lang.Integer> |
initializeList(ListInterface<java.lang.Integer> list,
int firstNumber,
int lastNumber,
int increment)
This method is called by the createList() method to initialize the test list.
|
static void |
main(java.lang.String[] args)
The main method executes all the test cases.
|
double |
memoryUsage()
This method is used to calculate the amount of memory being used in the JVM currently.
|
RunTime |
runTestCase(DriverInterface.ListType listType,
DriverInterface.TestType testType,
int numberOfTimes)
This method is called to run a particular test case on a list type a total of ten times.
|
public ListInterface<java.lang.Integer> createList(DriverInterface.ListType listType, DriverInterface.TestType forTestType)
DriverInterface
createList
in interface DriverInterface
listType
- This parameter specifies the type of list to create. See the enum DriverInterface.ListType
.forTestType
- This parameter specifies the type of test that the list is being created for. See the enum
DriverInterface.TestType
.public ListInterface<java.lang.Integer> initializeList(ListInterface<java.lang.Integer> list, int firstNumber, int lastNumber, int increment)
DriverInterface
initializeList
in interface DriverInterface
list
- The list 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 double memoryUsage()
DriverInterface
memoryUsage
in interface DriverInterface
double
representing the amount of memory in megabytes currently allocated in
the JVM. Please note that you must convert from kilobytes to megabytes.public RunTime runTestCase(DriverInterface.ListType listType, DriverInterface.TestType testType, int numberOfTimes)
DriverInterface
runTestCase
in interface DriverInterface
listType
- The type of list needed. See the enum DriverInterface.ListType
.testType
- The type of test case being run. See the enum DriverInterface.TestType
.numberOfTimes
- This parameter specifies the number of times to run the specified test.public static void main(java.lang.String[] args)