ru.greatbit.utils.tree.nodes.NaryNode Maven / Gradle / Ivy
package ru.greatbit.utils.tree.nodes;
import java.util.LinkedList;
import java.util.List;
/**
* Created by azee on 5/8/14.
* Used for simply non-oriented N-ary trees
*/
public class NaryNode extends Node{
private List children;
public NaryNode(K key, V value, List children) {
super(key, value);
this.children = children;
}
public NaryNode(K key, V value) {
super(key, value);
}
public NaryNode(List children) {
this.children = children;
}
public NaryNode() {}
@Override
public List getChildren() {
if (children == null){
children = new LinkedList();
}
return children;
}
}