N
- node typepublic interface TreeWalker<N extends TreeNode>
TreeWalker
you can quickly iterate through JTree
nodes to perform actions or check conditions.
Common TreeWalker
implementations will only iterate through nodes that currently exist within TreeModel
.Modifier and Type | Method and Description |
---|---|
boolean |
allMatch(Predicate<N> predicate)
Returns whether or not all of nodes walker passes match specified predicate.
|
boolean |
anyMatch(Predicate<N> predicate)
Returns whether or not any of nodes walker passes match specified predicate.
|
void |
forEach(Consumer<N> action)
Performs specified action for each node this walker passes.
|
boolean |
noneMatch(Predicate<N> predicate)
Returns whether or not none of nodes walker passes match specified predicate.
|
void forEach(Consumer<N> action)
action
- Consumer
containing action to perform on each nodeboolean anyMatch(Predicate<N> predicate)
predicate
- Predicate
containin condition for nodestrue
if any of nodes walker passes match specified predicate, false
otherwiseboolean allMatch(Predicate<N> predicate)
predicate
- Predicate
containin condition for nodestrue
if all of nodes walker passes match specified predicate, false
otherwiseCopyright © 2020. All rights reserved.