|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Interface for traversing a segment tree. A SegmentTreeVisitor
is passed as the first argument of
SegmentTree.traverse(SegmentTreeVisitor, ElementFilter); that visitor
object receives a message at each step in the traversal of a segment tree.
The sequence of calls is generally:
enter()beginElement() for each element beginning at this nodepreLeft(). If true:
enter(), etc.postLeft()preRight(). If true:
postRight()endElement() for each element ending at this node
| Method Summary | |
void |
beginElement(Element e)
Called for each Element beginning at this node. |
void |
endElement(Element e)
Called for each Element ending at this node. |
void |
enter(Position left,
Position right)
Called as a node of the segment tree is entered. |
void |
finished()
Called just before SegmentTree.traverse() returns. |
Object |
getData()
Retrieve data computed by the traversal. |
void |
postLeft(Position left,
Position mid,
Position right)
Called just after recursing to the left subtree. |
void |
postRight(Position left,
Position mid,
Position right)
Called just after recursing to the right subtree. |
boolean |
preLeft(Position left,
Position mid,
Position right)
Called just before recursing to the left subtree. |
boolean |
preRight(Position left,
Position mid,
Position right)
Called just before recursing to the right subtree. |
| Method Detail |
public void enter(Position left,
Position right)
throws TraversalException
left - the lower bound for this node.right - the upper bound for this node.
TraversalException - to end the traversal
public boolean preLeft(Position left,
Position mid,
Position right)
throws TraversalException
left - the left bound for this node and the left subtreemid - the right bound for the left subtreeright - the right bound for this node
TraversalException - to end the traversal
public void postLeft(Position left,
Position mid,
Position right)
throws TraversalException
left - the left bound for this node and the left subtreemid - the right bound for the left subtreeright - the right bound for this node
TraversalException - to end the traversal
public void beginElement(Element e)
throws TraversalException
Element beginning at this node. Called first
for tagged elements, in decreasing order of length, then for string
elements, in decreasing order of length.
e - the element.
TraversalException - to end the traversal
public void endElement(Element e)
throws TraversalException
Element ending at this node. Called first
for string elements, in increasing order of length, then for tagged
elements, in increasing order of length.
e - the element.
TraversalException - to end the traversal
public boolean preRight(Position left,
Position mid,
Position right)
throws TraversalException
left - the left bound for this nodemid - the left bound for the right subtreeright - the right bound for this node and the right subtree
TraversalException - to end the traversal
public void postRight(Position left,
Position mid,
Position right)
throws TraversalException
left - the left bound for this nodemid - the left bound for the right subtreeright - the right bound for this node and the right subtree
TraversalException - to end the traversal
public void finished()
throws TraversalException
SegmentTree.traverse() returns.
TraversalException - to end the traversalpublic Object getData()
SegmentTree.traverse().
null.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||