From d32221c6495c4d7937df30b057541606a8ce485e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 13 Sep 2016 22:37:24 +0100 Subject: [PATCH] ImmutableNodeItem: add javadoc --- .../net/kemitix/node/ImmutableNodeItem.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/java/net/kemitix/node/ImmutableNodeItem.java b/src/main/java/net/kemitix/node/ImmutableNodeItem.java index 020cdb9..009d2af 100644 --- a/src/main/java/net/kemitix/node/ImmutableNodeItem.java +++ b/src/main/java/net/kemitix/node/ImmutableNodeItem.java @@ -49,12 +49,33 @@ final class ImmutableNodeItem extends AbstractNodeItem { super(data, name, parent, children); } + /** + * Creates a new immutable root node. + * + * @param data the data of the node + * @param name the name of the node + * @param children the children of the node + * @param the type of the data in the node + * + * @return the new node tree's root node + */ static ImmutableNodeItem newRoot( final T data, final String name, final Set> children ) { return new ImmutableNodeItem<>(data, name, null, children); } + /** + * Creates a new immutable subtree from this child. + * + * @param data the data of the node + * @param name the name of the node + * @param parent the mutable parent of the node + * @param children the children of the node + * @param the type of the data in the node + * + * @return the new immutable node + */ static ImmutableNodeItem newChild( final T data, final String name, final Node parent, final Set> children ) {