uk.org.skeet.jbench.tasks
Class ListFill

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

public class ListFill
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
ListFill()
           
 
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()
          Create the instance, but don't populate it.
 void runTest()
          Runs the test itself - populates the list with size references to the current test.
 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

ListFill

public ListFill()
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
Create the instance, but don't populate it.
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 - populates the list with size references to the current test.
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