|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavafe.filespace.Tree
javafe.filespace.HashTree
javafe.filespace.PreloadedTree
A PreloadedTree is a HashTree whose edges map is loaded exactly once before any children-fetching queries complete; the loading is lazy, however, and occurs when the first children-fetching method is called.
If a subclass adds additional methods that refer to edges, it should make sure ensureEdgesLoaded is called before edges is used.
Field Summary | |
protected java.util.Hashtable |
edges
The mapping between our outgoing edge's labels and the subTrees they point to. |
private boolean |
loaded
Have we loaded the edges map yet? |
Fields inherited from class javafe.filespace.Tree |
data |
Constructor Summary | |
|
PreloadedTree(java.lang.Object data)
Create a root node: |
protected |
PreloadedTree(Tree parent,
java.lang.String label,
java.lang.Object data)
Create a non-root node: |
Method Summary | |
java.util.Enumeration |
children()
* Fetching and counting children: * * |
void |
ensureEdgesLoaded()
Ensure that the edges map is ready for use |
Tree |
getChild(java.lang.String label)
Fetch our direct child along the edge labelled label. |
protected abstract void |
loadEdges()
Load the edges map for use. |
Methods inherited from class javafe.filespace.Tree |
getChildrenCount, getLabel, getParent, getQualifiedChild, getQualifiedName, getRootNode, getSimpleName, isLeaf, print, printDetails |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean loaded
protected java.util.Hashtable edges
Invariant: all elements of edges are Trees and all keys are Strings.
Constructor Detail |
public PreloadedTree(java.lang.Object data)
protected PreloadedTree(Tree parent, java.lang.String label, java.lang.Object data)
Method Detail |
public final void ensureEdgesLoaded()
protected abstract void loadEdges()
public final java.util.Enumeration children()
children
in class HashTree
public final Tree getChild(java.lang.String label)
HashTree
getChild
in class HashTree
|
ESC/Java2 © 2003,2004,2005 David Cok and Joseph Kiniry © 2005 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |