/*
 * A Node wraps a Cell from the Map and includes
 * links to the neighbouring Nodes.
 */

public class Node
{
    public Node (Cell theCell)
    {
        _theCell = theCell;
    }

    public void setLinks (Node up, Node down, Node left, Node right)
    {
        _up = up;
        _down = down;
        _left = left;
        _right = right;
    }

    public Cell getCell ()
    {
        return _theCell;
    }

    @Override
    public int hashCode ()
    {
        return _theCell.hashCode();
    }

    @Override
    public boolean equals (Object obj)
    {
        if (obj == null)
            return false;

        if (this == obj)
            return true;
        
        if (getClass() == obj.getClass())
        {
            Node temp = (Node) obj;

            return temp._theCell.equals(_theCell);
        }

        return false;
    }

    private Cell _theCell = null;
    private Node _up = null;
    private Node _down = null;
    private Node _left = null;
    private Node _right = null;
}
@@ -403,32 +403,726 @@
 theCell;%0A    %7D%0A%0A
+    @Override%0A    public String toString ()%0A    %7B%0A        String str = %22Node: %22+_theCell+%22%5CnUp link: %22;%0A%0A        if (_up == null)%0A            str += %22empty%22;%0A        else%0A            str += _up.getCell().position();%0A%0A        str += %22%5CnDown link: %22;%0A%0A        if (_down == null)%0A            str += %22empty%22;%0A        else%0A            str += _down.getCell().position();%0A%0A        str += %22%5CnLeft link: %22;%0A%0A        if (_left == null)%0A            str += %22empty%22;%0A        else%0A            str += _left.getCell().position();%0A%0A        str += %22%5CnRight link: %22;%0A%0A        if (_right == null)%0A            str += %22empty%22;%0A        else%0A            str += _right.getCell().position();%0A%0A        return str;%0A    %7D%0A%0A
     @Override%0A  

Update Node.java