|
Devsphere.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.devsphere.xml.benchmark.MainBase
This is the base class for Main1
and Main2
and provides most of the functionality of the XML parsing benchmark.
Main1
,
Main2
Field Summary | |
protected java.lang.String |
command
The valid commands are: "create", "sax", "saxdomix" and "dom" |
protected java.util.Vector |
garbage
A container for the garbage that must not be collected |
protected boolean |
namespaces
Flag for enabling the namespace support |
protected int |
recordCount
The number of records of the XML database |
protected static java.lang.Runtime |
RUNTIME
A reusable java.lang.Runtime instance |
protected int |
threadCount
The number of concurrent threads that parse the database |
protected boolean |
validation
Flag for enabling the validation support |
Constructor Summary | |
protected |
MainBase(java.lang.String[] args)
Does the initialization |
Method Summary | |
protected void |
cacheFile(java.io.File file)
Caches a file into the operating system's memory by simply reading its content. |
protected void |
createDatabase(java.io.File dbFile)
Creates an XML database. |
protected void |
done()
Prints the time spent to perform the main task and the size of the used memory. |
protected javax.xml.parsers.DocumentBuilder |
getDocumentBuilder()
Returns a new DOM parser. |
protected javax.xml.parsers.SAXParser |
getSAXParser()
Returns a new SAX parser. |
protected void |
main()
Forwards the main task to the appropriate method |
protected void |
parseDatabase(java.io.File dbFile)
Forwards the parsing task to the appropriate method |
protected void |
parseDatabase(java.io.InputStream in)
Forwards the parsing task to the appropriate method |
protected void |
parseDatabaseMultithreading(java.io.File dbFile)
Creates multiple threads that parse the same database. |
protected abstract void |
parseWithDOM(java.io.InputStream in)
Parses an XML database with DOM |
protected abstract void |
parseWithSAX(java.io.InputStream in)
Parses an XML database with SAX |
protected abstract void |
parseWithSAXDOMIX(java.io.InputStream in)
Parses an XML database with SAXDOMIX |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.Runtime RUNTIME
java.lang.Runtime
instance
protected java.lang.String command
protected int recordCount
protected int threadCount
protected boolean namespaces
protected boolean validation
protected java.util.Vector garbage
Constructor Detail |
protected MainBase(java.lang.String[] args)
Method Detail |
protected void main() throws java.lang.Exception
java.lang.Exception
protected void done()
protected void createDatabase(java.io.File dbFile) throws java.io.IOException
java.io.IOException
protected abstract void parseWithSAX(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected abstract void parseWithSAXDOMIX(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected abstract void parseWithDOM(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected void parseDatabase(java.io.InputStream in) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected void parseDatabase(java.io.File dbFile) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected void parseDatabaseMultithreading(java.io.File dbFile) throws java.io.IOException, org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected javax.xml.parsers.SAXParser getSAXParser() throws org.xml.sax.SAXException, javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
protected javax.xml.parsers.DocumentBuilder getDocumentBuilder() throws javax.xml.parsers.ParserConfigurationException
javax.xml.parsers.ParserConfigurationException
protected void cacheFile(java.io.File file) throws java.io.IOException
java.io.IOException
|
Devsphere.com |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |