public class BinaryNode
{
    private Comparable data;
    private int level;
    private LList list;
    private boolean visited;
    private BinaryNode left, right;

    public BinaryNode(Comparable c, int l)
    {
	this(c,l,null,null);
    }

    public BinaryNode(Comparable c, int l, BinaryNode lt, BinaryNode rt)
    {
	data = c;
	level = l;
	list = null;
	visited = false;
	left = lt;
	right = rt;
    }

    public Comparable getData()
    {
	return data;
    }

    public int getLevel()
    {
	return level;
    }

    public LList getList()
    {
	return list;
    }

    public boolean getVisited()
    {
	return visited;
    }

    public BinaryNode getLeft()
    {
	return left;
    }

    public BinaryNode getRight()
    {
	return right;
    }

    public boolean isLeaf()
    {
	return (left == null && right == null);
    }

    public void setData(Comparable c)
    {
	data = c;
    }

    public void setLevel(int l)
    {
	level = l;
    }

    public void setList(LList l)
    {
	list = l;
    }

    public void setVisited(boolean b)
    {
	visited = b;
    }

    public void setLeft(BinaryNode n)
    {
	left = n;
    }

    public void setRight(BinaryNode n)
    {
	right = n;
    }

    public String toString()
    {
	return data.toString();
    }
}
