public class SimpleElementForest extends Object implements ElementForest
SimpleElement
s.Modifier | Constructor and Description |
---|---|
protected |
SimpleElementForest(API api) |
Modifier and Type | Method and Description |
---|---|
API |
getApi() |
SortedSet<? extends SimpleElement> |
getRoots()
A sorted set of all root elements of the forest.
|
<T extends Element> |
search(Class<T> resultType,
boolean recurse,
Filter<? super T> filter,
Element root)
Searches through the forest for elements of given type, potentially further filtering.
|
<T extends Element> |
search(List<T> results,
Class<T> resultType,
SortedSet<? extends Element> currentLevel,
boolean recurse,
Filter<? super T> filter) |
String |
toString() |
@Nonnull public API getApi()
getApi
in interface ElementForest
@Nonnull public SortedSet<? extends SimpleElement> getRoots()
ElementForest
getRoots
in interface ElementForest
@Nonnull public <T extends Element> List<T> search(@Nonnull Class<T> resultType, boolean recurse, @Nullable Filter<? super T> filter, @Nullable Element root)
ElementForest
If the searchRoot
is not null, this is technically equivalent to calling the
Element.searchChildren(java.lang.Class, boolean, org.revapi.query.Filter)
on the
searchRoot
.
search
in interface ElementForest
T
- the type of the elements to look forresultType
- the type of the elements to be contained in the resultsrecurse
- false to only search direct children, true for searching recursivelyfilter
- the optional filterroot
- optional element from which to conduct the searchpublic <T extends Element> void search(@Nonnull List<T> results, @Nonnull Class<T> resultType, @Nonnull SortedSet<? extends Element> currentLevel, boolean recurse, @Nullable Filter<? super T> filter)
Copyright © 2014-2020 Lukas Krejci. All Rights Reserved.