@FunctionalInterface
public interface TreeDef<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
TreeDef.Parented<T>
A "doubly-linked" tree, where nodes know about both their parent and their children.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<T> |
childrenOf(T node)
Returns all the children of the given node.
|
default TreeDef<T> |
filter(java.util.function.Predicate<T> predicate)
Returns a new TreeDef which whose childrenOf() method is filtered by the given predicate.
|
static <T> java.util.List<T> |
filteredList(java.util.List<T> unfiltered,
java.util.function.Predicate<T> filter)
Returns a filtered version of the given list.
|
static <T> TreeDef<T> |
of(java.util.function.Function<T,java.util.List<T>> childFunc)
Creates a TreeDef which is implemented by the given function.
|
default TreeDef<T> filter(java.util.function.Predicate<T> predicate)
static <T> TreeDef<T> of(java.util.function.Function<T,java.util.List<T>> childFunc)
static <T> java.util.List<T> filteredList(java.util.List<T> unfiltered, java.util.function.Predicate<T> filter)