|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.skeet.jbench.tasks.ArrayFill
Abstract class to enable simple array-fill benchmarking.
It is assumed that all subclasses will try to fill the same
amount of data (otherwise the benchmark is useless). To this
end, subclasses should use the size
parameter
to determine the size of array to fill. (There may, of course,
be one set of subclasses which are compatible with each other
but incompatible with another set; so long as they use size
in the same way, this is fine.)
Constructor Summary | |
ArrayFill()
|
Method Summary | |
void |
checkConfiguration()
Checks that we have a positive size and number of iterations |
void |
checkResults()
No checking - we're lazy by default. |
protected abstract void |
fillArray()
Fills the array. |
java.lang.String |
getDescription()
Default description which gives the name of the actual class, the size of the array, and the number of iterations. |
protected int |
getSize()
Returns the size to test |
abstract void |
prepareTest()
Creates the array to be filled during the test. |
void |
runTest()
Simply calls fillArray() however many
times has been specified by iterations . |
void |
setIterations(int value)
Sets the number of iterations per test |
void |
setSize(int value)
Sets the size to test |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayFill()
Method Detail |
public void setIterations(int value)
public void setSize(int value)
protected int getSize()
public void checkConfiguration() throws ConfigurationException
checkConfiguration
in interface BenchTask
uk.org.skeet.jbench.BenchTask
ConfigurationException
- if the configuration specified is incomplete
or invalid.public void runTest() throws TaskException
fillArray()
however many
times has been specified by iterations
.
This is done to increase the length of the task - it
is assumed that no further preparation is actually
necessary for reset.runTest
in interface BenchTask
uk.org.skeet.jbench.BenchTask
TaskException
- if the test failed to complete normally.protected abstract void fillArray() throws TaskException
public abstract void prepareTest() throws TaskException
prepareTest
in interface BenchTask
uk.org.skeet.jbench.BenchTask
TaskException
- if the preparation failed.public void checkResults()
checkResults
in interface BenchTask
uk.org.skeet.jbench.BenchTask
TaskException
- if the test failed.public java.lang.String getDescription()
getDescription
in interface BenchTask
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |