E
- the base type of all the elements produced by some API analyzerpublic class BaseElementForest<E extends Element<E>> extends Object implements ElementForest<E>
ElementForest.Visitor<E extends Element<E>>
Constructor and Description |
---|
BaseElementForest(API api) |
Modifier and Type | Method and Description |
---|---|
API |
getApi() |
SortedSet<E> |
getRoots()
A sorted set of all root elements of the forest.
|
protected SortedSet<E> |
newRootsInstance() |
protected <T extends Element<E>> |
search(List<T> results,
Class<T> resultType,
SortedSet<E> siblings,
boolean recurse,
TreeFilter<E> filter) |
<T extends Element<E>> |
stream(Class<T> resultType,
boolean recurse,
TreeFilter<E> filter,
Element<E> root)
Walks through the forest and returns a stream of elements that match the provided filter.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
empty, iterateOverElements, search, stream, walk, walk
public BaseElementForest(API api)
public API getApi()
getApi
in interface ElementForest<E extends Element<E>>
public SortedSet<E> getRoots()
ElementForest
getRoots
in interface ElementForest<E extends Element<E>>
public <T extends Element<E>> java.util.stream.Stream<T> stream(Class<T> resultType, boolean recurse, TreeFilter<E> filter, Element<E> root)
ElementForest
stream
in interface ElementForest<E extends Element<E>>
T
- the expected type of resultsresultType
- the expected type of resultsrecurse
- whether to recursively descend into children. If false, only the direct children of the
root are searched.filter
- the filter to use when looking for matching childrenroot
- the search root. If null, the whole element forest is searchedprotected <T extends Element<E>> void search(List<T> results, Class<T> resultType, SortedSet<E> siblings, boolean recurse, TreeFilter<E> filter)
Copyright © 2014-2021 Lukas Krejci. All Rights Reserved.