NodeItem: add all args constructor

This commit is contained in:
Paul Campbell 2016-09-20 22:12:29 +01:00
parent 22518df8b9
commit 7f0f0d1bf9

View file

@ -50,6 +50,23 @@ class NodeItem<T> implements Node<T> {
private String name;
/**
* Constructor.
*
* @param data the data of the node
* @param name the name of the node
* @param parent the parent of the node, or null for a root node
* @param children the children of the node - must not be null
*/
NodeItem(
final T data, final String name, final Node<T> parent, @NonNull final Set<Node<T>> children
) {
this.data = data;
this.name = name;
this.parent = parent;
this.children.addAll(children);
}
/**
* Create named root node.
*