uk.org.skeet.jbench.tasks
Class ListSort

java.lang.Object
  |
  +--uk.org.skeet.jbench.tasks.ListSort
All Implemented Interfaces:
BenchTask

public class ListSort
extends java.lang.Object
implements BenchTask

Very simple implementation of BenchTask. This just sorts a specified number of integers in a specified type of list.


Constructor Summary
ListSort()
           
 
Method Summary
 void checkConfiguration()
          Checks that the configuration is valid
 void checkResults()
          Checks the results
 java.lang.String getDescription()
          Returns a description of the test, including the parameters
 void prepareTest()
          Prepares a test by creating and populating a list
 void runTest()
          Runs the test itself
 void setSize(int size)
          Sets the size of the test, ie the number of elements to sort
 void setType(java.lang.Class listType)
          Sets the type of list to use, eg java.util.ArrayList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListSort

public ListSort()
Method Detail

setType

public void setType(java.lang.Class listType)
Sets the type of list to use, eg java.util.ArrayList

setSize

public void setSize(int size)
Sets the size of the test, ie the number of elements to sort

checkConfiguration

public void checkConfiguration()
                        throws ConfigurationException
Checks that the configuration is valid
Specified by:
checkConfiguration in interface BenchTask
Following copied from interface: uk.org.skeet.jbench.BenchTask
Throws:
ConfigurationException - if the configuration specified is incomplete or invalid.

prepareTest

public void prepareTest()
                 throws TaskException
Prepares a test by creating and populating a list
Specified by:
prepareTest in interface BenchTask
Following copied from interface: uk.org.skeet.jbench.BenchTask
Throws:
TaskException - if the preparation failed.

runTest

public void runTest()
Runs the test itself
Specified by:
runTest in interface BenchTask
Following copied from interface: uk.org.skeet.jbench.BenchTask
Throws:
TaskException - if the test failed to complete normally.

checkResults

public void checkResults()
                  throws TaskException
Checks the results
Specified by:
checkResults in interface BenchTask
Following copied from interface: uk.org.skeet.jbench.BenchTask
Throws:
TaskException - if the test failed.

getDescription

public java.lang.String getDescription()
Returns a description of the test, including the parameters
Specified by:
getDescription in interface BenchTask