import java.util.LinkedList;
/**
* Write a description of class TreeNode here.
*
* @author (Muhammad Norzariman)
* @version (0.1)
*/
public class TreeNode
{
// instance variables - replace the example below with your own
private LinkedList link;
private Object data;
/**
* Constructor for objects of class TreeNode
*/
public TreeNode()
{
data=null;
link=new LinkedList();
}
public TreeNode(Object obj)
{
data=obj;
link=new LinkedList();
}
public void addChild(Object obj){
link.add(new TreeNode(obj));
}
public TreeNode getChild(int loc){
return (TreeNode)link.get(loc);
}
public Object getData(){
return data;
}
public int count(){
return link.size();
}
}