|
qflib 0.98.1 | ||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
MutableTraversal | Extension of the Traversal interface that enables modification of the tree during traversal. |
MutableTreeAdapter | This extension of the TreeAdapter interface has to be implemented in order to support mutable tree hierarchies. |
NodeFactory | This interface must be implement in order to create a tree with a TreeBuilder . |
Traversal | This interface is implemented by classes that traverse a tree. |
TraversalCallback | This interface must be implemented when traversing a tree with TreeUtil.traverse or TreeUtil.traverseFrom . |
TreeAdapter | With the help of this interface the methods of the TreeUtil class can be applied to every kind of tree structure without
the need to change anything in the implementation of the structure itself
(provided that the basic tree functionality is there). |
Class Summary | |
AbstractTraversal | Abstract base class for implementations of the Traversal interface. |
AbstractTraversal.Level | Structure that holds information about one level of the tree. |
IndexBasedTreeAdapter | This abstract base class for an index based TreeAdapter implements the link and enumeration based methods in terms of the index based ones, so it leaves only the bare minimum to be implemented. |
IndexTraversal | Index based tree traversal. |
TreeBuilder | Helper class that simplifies building a tree from some kind of data, e.g. a file. |
TreeUtil | This is a collection of static convenience methods that are useful for tree management. |
Exception Summary | |
ReturnFromTraversalException | Special Exception that signals a premature end of a tree traversal and passes a result value back to the original caller. |
Experimental - This package is currently under development and its interfaces are likely to change!
A set of classes and interfaces for generic tree traversal and manipulation.
Trees are a very common and useful kind of data structure. Typically trees are implemented in different ways however, so it is hard to write a set of utilities applicable to every kind of tree.
Most trees are implemented in terms of an interface for their nodes,
which have some kind of parent/child relationship. One notable
exception is the TreeModel
approach used by Swing. Instead of requiring a special node interface,
almost anything with an underlying tree structure can be converted
into something useful be implementing a TreeModel for it.
This package is based on the interface TreeAdapter
which is similar to
TreeModel, but doesn't require the TreeModelListener support and the
valueForPathChanged method, which are Swing specific. Instead it
supports different kinds of trees:
AWTTreeAdapter
or OptionGroupTreeAdapter
for an example.
The class TreeUtil
is a collection of
useful methods for tree traversal and manipulation. Trees can be
traversed in two ways: visitTree
calls Visitor.visit
on each node with its visitor argument while traverse
employs the Traversal
and TraversalCallback
interfaces to
notify the callback on entry and exit to every node. If a MutableTreeAdapter
is used, the
tree can be modified during traversal.
Building trees, e.g. by parsing a file, is supported through the
TreeBuilder
class.
Future plans include multithreading support, adapters and builders for XML DOM and SAX.
|
qflib 0.98.1 | ||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |