|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--de.qfs.lib.tree.TreeBuilder
Helper class that simplifies building a tree from some kind of data, e.g. a file.
Field Summary | |
protected MutableTreeAdapter |
adapter
The adapter used for tree manipulation. |
protected java.lang.Object |
currentNode
The current node during the build process- |
protected static java.lang.Object |
dummy
Dummy object to represent null nodes internally. |
protected NodeFactory |
factory
The node factory used to create the nodes. |
protected boolean |
first
Flag to check for the root node. |
protected java.util.Vector |
path
The path to the current node. |
protected java.lang.Object |
root
The root object of the new tree. |
Constructor Summary | |
TreeBuilder(MutableTreeAdapter adapter,
NodeFactory factory)
Create a new TreeBuilder. |
Method Summary | |
java.lang.Object |
closeNode()
Close the current node. |
java.lang.Object |
getRoot()
Get the root node of the new tree. |
java.lang.Object |
openNode(java.lang.Object data)
Open a new node. |
void |
reset()
Reset the TreeBuilder to build a new tree. |
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.Object dummy
protected boolean first
protected MutableTreeAdapter adapter
protected NodeFactory factory
protected java.lang.Object root
protected java.lang.Object currentNode
protected java.util.Vector path
Constructor Detail |
public TreeBuilder(MutableTreeAdapter adapter, NodeFactory factory)
adapter
- The adapter to use for tree manipulation.factory
- The node factory to use to create the nodes.Method Detail |
public java.lang.Object openNode(java.lang.Object data)
data
- The data for the new node.public java.lang.Object closeNode()
public java.lang.Object getRoot()
public void reset()
|
qflib 0.98.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |