|
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.ExtTree
A ExtTree is a HashTree that starts out as just a root node, but may be extended at any time by (recursively) adding children.
Edges and nodes cannot be deleted once added, however.
Field Summary | |
protected java.util.Hashtable |
edges
The mapping between our outgoing edge's labels and the subTrees they point to. |
Fields inherited from class javafe.filespace.Tree |
data |
Constructor Summary | |
|
ExtTree(java.lang.Object data)
Create a root node: |
protected |
ExtTree(Tree parent,
java.lang.String label,
java.lang.Object data)
Create a non-root node: |
Method Summary | |
ExtTree |
addChild(java.lang.String label,
java.lang.Object newData)
Create a new direct child of us with label label and data newData. |
ExtTree |
addPath(java.lang.String[] path)
This is an extended version of addChild that takes a path (a list of labels) instead of a single label. |
java.util.Enumeration |
children()
An enumeration of this node's direct children. |
Tree |
getChild(java.lang.String label)
Fetch our direct child along the edge labelled label. |
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 |
protected java.util.Hashtable edges
Invariant: all elements of edges are Trees and all keys are Strings.
Constructor Detail |
public ExtTree(java.lang.Object data)
protected ExtTree(Tree parent, java.lang.String label, java.lang.Object data)
Method Detail |
public ExtTree addChild(java.lang.String label, java.lang.Object newData)
If a child by the name of label already exists, then this routine leaves the tree unchanged.
In either case, the (resulting) child with label label is returned.
public ExtTree addPath(java.lang.String[] path)
public java.util.Enumeration children()
Note: The Objects returned by the resulting enumeration's nextElement method are guaranteed to be of type Tree and non-null.
children
in class Tree
public Tree getChild(java.lang.String label)
getChild
in class Tree
|
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 |