| java.lang.Object com.sosnoski.xmlbench.BenchBase com.sosnoski.xmlbench.BenchDocBase
All known Subclasses: com.sosnoski.xmlbench.BenchDOM4J, com.sosnoski.xmlbench.BenchXPP, com.sosnoski.xmlbench.BenchJDOM, com.sosnoski.xmlbench.BenchDOM, com.sosnoski.xmlbench.BenchElectric,
BenchDocBase | abstract public class BenchDocBase extends BenchBase (Code) | | 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.
author: Dennis M. Sosnoski version: 1.2 |
BenchDocBase | protected BenchDocBase(String config)(Code) | | Constructor.
Parameters: config - test configuration name |
build | abstract protected Object build(InputStream in)(Code) | | Build document representation by parsing XML. This method must be
implemented by each subclass to use the appropriate construction
technique.
Parameters: in - XML document input stream document representation |
modify | abstract protected void modify(Object document)(Code) | | Modify a document representation. This method must be implemented by each
subclass to walk the document representation performing the following
modifications: remove all content segments which consist only of
whitespace; add an attribute "text" set to "true" to any elements which
directly contain non-whitespace text content; and replace each
non-whitespace text content segment with a "text" element which wraps
the content.
Parameters: doc - document representation to be modified |
output | abstract protected void output(Object document, OutputStream out)(Code) | | Output a document as XML text. This method must be implemented by each
subclass to use the appropriate output technique.
Parameters: doc - document representation to be output Parameters: out - XML document output stream |
reset | protected void reset()(Code) | | Reset test class instance. This method should be overridden by any
subclasses which retain state information during the execution of a
test. Any such information should be cleared when this method is called.
|
runSpaceTest | public int[] runSpaceTest(int passes, int excludes, byte[][] texts)(Code) | | Main space test method. This implementation of the abstract base class
method performs the normal sequence of space tests.
Parameters: passes - number of passes of each test Parameters: excludes - number of initialization passes excluded from averages Parameters: texts - document texts for test result values array |
runTimeTest | public int[] runTimeTest(int passes, int excludes, byte[][] texts)(Code) | | Main time test method. This implementation of the abstract base class
method performs the normal sequence of speed tests. Subclasses which
cannot use the normal test sequence must override this method with
their own variation.
Parameters: passes - number of passes of each test Parameters: excludes - number of initialization passes excluded from averages Parameters: texts - document texts for test result times array |
serialize | protected boolean serialize(Object doc, OutputStream out)(Code) | | Serialize a document to a byte array.
Parameters: doc - document representation to be serialized Parameters: out - serialized document output stream true if successful, false ifrepresentation does not support serialization |
unserialize | protected Object unserialize(InputStream in)(Code) | | Unserialize a document from a byte array.
Parameters: in - serialized document input stream unserialized document representation |
walk | abstract protected void walk(Object doc, DocumentSummary summary)(Code) | | Walk and summarize document. This method should walk through the nodes
of the document, accumulating summary information. It must be
implemented by each subclass.
Parameters: doc - document representation to be walked Parameters: summary - output document summary information |
|
|