Class TreeCache
java.lang.Object
org.dlese.dpc.schemedit.standards.TreeCache
Cashe of AsnStandardsDocuments. Works with a
StandardsRegistry instance to support
the "getStandardsDocument" call. Maintains a tree map of specified size.
When a call to getStandardsDocument is called: - Most recently used list is
updated to put that tree first. - if requested tree is not in the tree map,
the least recently used tree is destroyed and the requested tree is read
(using path obtained from the Registry).- Author:
- Jonathan Ostwald
-
Constructor Summary
ConstructorsConstructorDescriptionTreeCache(StandardsRegistry standardsRegistry) Constructor for the TreeCache object -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTree(String key, AsnStandardsDocument tree) Description of the MethodgetStandardsNode(String asnId) Gets the standardsNode attribute of the TreeCache objectgetStandardsNodeOLD(String asnId) Gets the standardsNode attribute of the TreeCache objectGet the StandardsTree specified by provided key.booleanisFull()Gets the full attribute of the TreeCache objectstatic voidThe main program for the TreeCache classvoidRemove least recently used tree from the cachevoidremoveTree(String key) Remove specified tree from the cachevoidreport()NOT YET DOCUMENTED
-
Constructor Details
-
TreeCache
Constructor for the TreeCache object- Parameters:
standardsRegistry- NOT YET DOCUMENTED- Throws:
Exception- NOT YET DOCUMENTED
-
-
Method Details
-
addTree
Description of the Method- Parameters:
key- Document key of the form (. . . ) tree- Description of the Parameter
-
isFull
public boolean isFull()Gets the full attribute of the TreeCache object- Returns:
- The full value
-
removeTree
public void removeTree()Remove least recently used tree from the cache -
removeTree
Remove specified tree from the cache- Parameters:
key- key of asnStandardsDocument
-
getTree
Get the StandardsTree specified by provided key.if the treeMap.containsKey(key) - usageQueue.touch(key) otherwise - tree = new AsnStandardsDocument (key) - addTree (key, tree) return treeMap.get(key)
- Parameters:
key- document key (e.g., "AAAS.Science.1993.D1000152")- Returns:
- The the standards document for specified key.
-
getStandardsNodeOLD
Gets the standardsNode attribute of the TreeCache object- Parameters:
asnId- Description of the Parameter- Returns:
- The standardsNode value
-
getStandardsNode
Gets the standardsNode attribute of the TreeCache object- Parameters:
asnId- NOT YET DOCUMENTED- Returns:
- The standardsNode value
- Throws:
Exception- NOT YET DOCUMENTED
-
report
public void report()NOT YET DOCUMENTED -
main
The main program for the TreeCache class- Parameters:
args- The command line arguments- Throws:
Exception- NOT YET DOCUMENTED
-