public interface TreeFilter<E extends Element<E>>
As a caller of some implementation of this interface, please study the documentation of the individual methods on this interface to learn at what times the methods are supposed to be called.
Modifier and Type | Method and Description |
---|---|
Map<E,FilterFinishResult> |
finish()
Called after all elements have been processed to see if any of them have changed in their filtering
result (which could be the case if there are dependencies between elements other than that of parent-child).
|
FilterFinishResult |
finish(E element)
This method is called after the filtering has
started and all children have
been processed by this filter. |
static <E extends Element<E>> |
matchAndDescend() |
FilterStartResult |
start(E element)
This method is called when an element is about to be filtered.
|
static <E extends Element<E>> |
union(List<TreeFilter<E>> fs) |
static <E extends Element<E>> |
union(TreeFilter<E>... fs) |
static <E extends Element<E>> TreeFilter<E> matchAndDescend()
@SafeVarargs static <E extends Element<E>> TreeFilter<E> union(TreeFilter<E>... fs)
static <E extends Element<E>> TreeFilter<E> union(List<TreeFilter<E>> fs)
FilterStartResult start(E element)
finish(Element)
will
be called with the same element as this method.element
- the element to start filteringFilterFinishResult finish(E element)
started
and all children have
been processed by this filter.
Note that the result can still be FilterMatch.UNDECIDED
. It is expected that such elements
will in the end be resolved with the finish()
method.
element
- the element for which the filtering has finishedMap<E,FilterFinishResult> finish()
Note that the result can remain FilterMatch.UNDECIDED
. It is upon the caller to then decide what to do
with such elements.
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.