| Modifier and Type | Field and Description |
|---|---|
protected java.util.function.Function<T,T> |
childToParent |
protected java.util.function.BiFunction<T,List<T>,T> |
copyNode |
protected java.util.function.Function<T,List<T>> |
parentToChildren |
protected T |
root |
| Constructor and Description |
|---|
TreeImpl(T root,
java.util.function.Function<T,List<T>> parentToChildren,
java.util.function.Function<T,T> childToParent,
java.util.function.BiFunction<T,List<T>,T> copyNode) |
| Modifier and Type | Method and Description |
|---|---|
T |
copy(T node,
List<T> children)
Copies a given node thereby setting the provided children as its children.
|
static <T> TreeImpl<T> |
create(T root,
java.util.function.Function<T,List<T>> parentToChildren) |
Tree<T> |
createNew(T root) |
boolean |
equals(Object obj) |
List<T> |
getChildren(T node) |
T |
getParent(T node) |
T |
getRoot() |
int |
hashCode() |
String |
toString() |
protected T root
protected java.util.function.Function<T,List<T>> parentToChildren
protected java.util.function.Function<T,T> childToParent
protected java.util.function.BiFunction<T,List<T>,T> copyNode
public TreeImpl(T root, java.util.function.Function<T,List<T>> parentToChildren, java.util.function.Function<T,T> childToParent, java.util.function.BiFunction<T,List<T>,T> copyNode)
public T getRoot()
public static <T> TreeImpl<T> create(T root, java.util.function.Function<T,List<T>> parentToChildren)
Copyright © 2018. All rights reserved.