Nodes: use new NodeItem constructor
This commit is contained in:
parent
7f0f0d1bf9
commit
dda6acc047
2 changed files with 6 additions and 5 deletions
|
@ -208,7 +208,7 @@ class NodeItem<T> implements Node<T> {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Node<T> createChild(@NonNull final T child) {
|
public Node<T> createChild(@NonNull final T child) {
|
||||||
return new NodeItem<>(child, this);
|
return new NodeItem<>(child, "", this, new HashSet<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -24,6 +24,7 @@ SOFTWARE.
|
||||||
|
|
||||||
package net.kemitix.node;
|
package net.kemitix.node;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
@ -47,7 +48,7 @@ public final class Nodes {
|
||||||
* @return the new node
|
* @return the new node
|
||||||
*/
|
*/
|
||||||
public static <T> Node<T> unnamedRoot(final T data) {
|
public static <T> Node<T> unnamedRoot(final T data) {
|
||||||
return new NodeItem<>(data);
|
return new NodeItem<>(data, "", null, new HashSet<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +61,7 @@ public final class Nodes {
|
||||||
* @return the new node
|
* @return the new node
|
||||||
*/
|
*/
|
||||||
public static <T> Node<T> namedRoot(final T data, final String name) {
|
public static <T> Node<T> namedRoot(final T data, final String name) {
|
||||||
return new NodeItem<>(data, name);
|
return new NodeItem<>(data, name, null, new HashSet<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -73,7 +74,7 @@ public final class Nodes {
|
||||||
* @return the new node
|
* @return the new node
|
||||||
*/
|
*/
|
||||||
public static <T> Node<T> unnamedChild(final T data, final Node<T> parent) {
|
public static <T> Node<T> unnamedChild(final T data, final Node<T> parent) {
|
||||||
return new NodeItem<>(data, parent);
|
return new NodeItem<>(data, "", parent, new HashSet<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,7 +90,7 @@ public final class Nodes {
|
||||||
public static <T> Node<T> namedChild(
|
public static <T> Node<T> namedChild(
|
||||||
final T data, final String name, final Node<T> parent
|
final T data, final String name, final Node<T> parent
|
||||||
) {
|
) {
|
||||||
return new NodeItem<>(data, name, parent);
|
return new NodeItem<>(data, name, parent, new HashSet<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue