|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.bebop.util.Traversal
A utility class for walking down a tree of Bebop components and performing some work on each one.
Uses a filter to perform the action only on certain components. This filter may be used to skip only individual components or entire subtrees. The default filter matches all components.
Field Summary | |
static int |
PERFORM_ACTION
If test returns PERFORM_ACTION ,
then the action is performed on the component and its children. |
static int |
SKIP_COMPONENT
If test returns SKIP_COMPONENT ,
then the current component is skipped but its descendants are still
traversed. |
static int |
SKIP_SUBTREE
If test returns SKIP_SUBTREE ,
then the current component and all of its descendants are skipped. |
static String |
versionId
|
Constructor Summary | |
Traversal()
|
Method Summary | |
protected abstract void |
act(Component c)
Defines the action to be performed on each node. |
void |
preorder(Component c)
Invoke act(com.arsdigita.bebop.Component) on this component, and then do the same for
each of its children for which the supplied
test condition is true. |
protected int |
test(Component c)
The default component test returns PERFORM_ACTION
to act on all components in the tree. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int PERFORM_ACTION
test
returns PERFORM_ACTION
,
then the action is performed on the component and its children.
(This is the default.)
public static final int SKIP_COMPONENT
test
returns SKIP_COMPONENT
,
then the current component is skipped but its descendants are still
traversed.
public static final int SKIP_SUBTREE
test
returns SKIP_SUBTREE
,
then the current component and all of its descendants are skipped.
public static final String versionId
Constructor Detail |
public Traversal()
Method Detail |
protected abstract void act(Component c)
c
- the component on which to perform this action.public void preorder(Component c)
act(com.arsdigita.bebop.Component)
on this component, and then do the same for
each of its children for which the supplied
test
condition is true.
c
- the component on which to call act(com.arsdigita.bebop.Component)
.protected int test(Component c)
PERFORM_ACTION
to act on all components in the tree. Override this method
to supply your own component test.
c
- the component to test
PERFORM_ACTION
on all
components.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |