@FunctionalInterface public interface TreeDef<T>
TreeStream
,
TreeQuery
,
TreeComparison
,
TreeIterable
,
TreeNode
Modifier and Type | Interface and Description |
---|---|
static interface |
TreeDef.Parented<T>
A pair of functions which define a doubly-linked tree, where nodes know about both their parent and their children.
|
Modifier and Type | Method and Description |
---|---|
List<T> |
childrenOf(T node)
Returns all the children of the given node.
|
default TreeDef<T> |
filter(Predicate<T> predicate)
Creates a new TreeDef which whose
childrenOf method is filtered by the given predicate. |
static <T> List<T> |
filteredList(List<T> unfiltered,
Predicate<T> filter)
Returns a filtered version of the given list.
|
static TreeDef.Parented<File> |
forFile(Consumer<Throwable> errorPolicy)
An instance of
TreeDef.Parented for File . |
static TreeDef.Parented<Path> |
forPath(Consumer<Throwable> errorPolicy)
An instance of
TreeDef.Parented for Path . |
static <T> TreeDef<T> |
of(Function<T,List<T>> childFunc)
Creates a TreeDef which is implemented by the given function.
|
default TreeDef<T> filter(Predicate<T> predicate)
childrenOf
method is filtered by the given predicate.static <T> TreeDef<T> of(Function<T,List<T>> childFunc)
static <T> List<T> filteredList(List<T> unfiltered, Predicate<T> filter)
static TreeDef.Parented<File> forFile(Consumer<Throwable> errorPolicy)
TreeDef.Parented
for File
.static TreeDef.Parented<Path> forPath(Consumer<Throwable> errorPolicy)
TreeDef.Parented
for Path
.