|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.refimpl.bridge.BufferedDocumentLoader
A buffered document loader. This loader caches documents depending on the total number of nodes of each document. If the total number of cached nodes is greater than MAX_CACHED_NODE_COUNT, the oldest document is removed from the cache.
Field Summary | |
protected int |
currentCachedNodeCount
The current number of cached nodes. |
protected java.util.List |
documentList
A list of the DocumentState. |
protected DocumentLoader |
documentLoader
The enclosed document loader used to load the document when needed. |
protected java.util.HashMap |
documentMap
The map that contains the Document indexed by the URI. |
static int |
MAX_CACHED_NODE_COUNT
The maximum number of cachable nodes. |
Constructor Summary | |
BufferedDocumentLoader(DocumentLoader documentLoader)
Constructs a new DocumentLoader using the specified document loader to load a document. |
Method Summary | |
void |
dispose()
Disposes and releases all resources allocated by this document loader. |
protected org.apache.batik.refimpl.bridge.BufferedDocumentLoader.DocumentState |
getDocumentState(Document document)
Returns the DocumentState of the specified Document. |
protected int |
getNodeCount(Node n)
Returns the number of nodes in the specified document. |
Document |
loadDocument(java.lang.String uri)
Returns the document associated to the specified URI. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_CACHED_NODE_COUNT
protected DocumentLoader documentLoader
protected java.util.HashMap documentMap
protected java.util.List documentList
protected int currentCachedNodeCount
Constructor Detail |
public BufferedDocumentLoader(DocumentLoader documentLoader)
documentLoader
- the document loader used to load a documentMethod Detail |
public Document loadDocument(java.lang.String uri) throws DOMException, SAXException, java.lang.InterruptedException
loadDocument
in interface DocumentLoader
uri
- the uri of the document to returnjava.lang.InterruptedException
- is thrown if this thread is interrupted.public void dispose()
DocumentLoader
dispose
in interface DocumentLoader
protected org.apache.batik.refimpl.bridge.BufferedDocumentLoader.DocumentState getDocumentState(Document document)
document
- the documentprotected int getNodeCount(Node n)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |