|
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||
java.lang.Object
|
+--com.sosnoski.xmlbench.BenchBase
|
+--com.sosnoski.xmlbench.BenchDocBase
Abstract base class for document representation benchmark tests. This class defines the basic tests along with some implementation methods which must be defined by the subclass for each particular document representation to be tested.
| Constructor Summary | |
protected |
BenchDocBase(java.lang.String config)
Constructor. |
| Method Summary | |
protected abstract java.lang.Object |
build(java.io.InputStream in)
Build document representation by parsing XML. |
protected abstract void |
modify(java.lang.Object document)
Modify a document representation. |
protected abstract void |
output(java.lang.Object document,
java.io.OutputStream out)
Output a document as XML text. |
protected void |
reset()
Reset test class instance. |
int[] |
runSpaceTest(int passes,
int excludes,
byte[][] texts)
Main space test method. |
int[] |
runTimeTest(int passes,
int excludes,
byte[][] texts)
Main time test method. |
protected boolean |
serialize(java.lang.Object doc,
java.io.OutputStream out)
Serialize a document to a byte array. |
protected java.lang.Object |
unserialize(java.io.InputStream in)
Unserialize a document from a byte array. |
protected abstract void |
walk(java.lang.Object doc,
DocumentSummary summary)
Walk and summarize document. |
| Methods inherited from class com.sosnoski.xmlbench.BenchBase |
getName, initMemory, initTime, printSummary, reportSpace, reportTime, reportValue, setPrint, setShowDocument, setShowPass, setVariant, testPassSpace, testPassTime |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected BenchDocBase(java.lang.String config)
config - test configuration name| Method Detail |
protected abstract java.lang.Object build(java.io.InputStream in)
in - XML document input stream
protected abstract void walk(java.lang.Object doc,
DocumentSummary summary)
doc - document representation to be walkedsummary - output document summary information
protected abstract void output(java.lang.Object document,
java.io.OutputStream out)
doc - document representation to be outputout - XML document output streamprotected abstract void modify(java.lang.Object document)
doc - document representation to be modifiedprotected void reset()
protected boolean serialize(java.lang.Object doc,
java.io.OutputStream out)
doc - document representation to be serializedout - serialized document output streamtrue if successful, false if
representation does not support serializationprotected java.lang.Object unserialize(java.io.InputStream in)
in - serialized document input stream
public int[] runTimeTest(int passes,
int excludes,
byte[][] texts)
runTimeTest in class BenchBasepasses - number of passes of each testexcludes - number of initialization passes excluded from averagestexts - document texts for test
public int[] runSpaceTest(int passes,
int excludes,
byte[][] texts)
runSpaceTest in class BenchBasepasses - number of passes of each testexcludes - number of initialization passes excluded from averagestexts - document texts for test
|
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||