@FunctionalInterface public interface TreeDef<T>
A function which defines a tree structure.
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 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)
Creates a new TreeDef which whose childrenOf
method is filtered by the given predicate.
static <T> TreeDef<T> of(Function<T,List<T>> childFunc)
Creates a TreeDef which is implemented by the given function.
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
.