/*
 * 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 boolean getVisited ()
    {
        return _visited;
    }

    public void setVisited ()
    {
        _visited = true;
    }
    
    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 String toString ()
    {
        String str = "Node: "+_theCell+"\nUp link: ";

        if (_up == null)
            str += "empty";
        else
            str += _up.getCell().position();

        str += "\nDown link: ";

        if (_down == null)
            str += "empty";
        else
            str += _down.getCell().position();

        str += "\nLeft link: ";

        if (_left == null)
            str += "empty";
        else
            str += _left.getCell().position();

        str += "\nRight link: ";

        if (_right == null)
            str += "empty";
        else
            str += _right.getCell().position();

        return str;
    }

    @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;
    private boolean _visited = false;
}
@@ -197,19 +197,23 @@
 boolean 
-get
+hasBeen
 Visited 
@@ -269,19 +269,22 @@
 ic void 
-set
+markAs
 Visited 
@@ -323,21 +323,267 @@
 ;%0A    %7D%0A
-
     %0A
+    public Node getUp ()%0A    %7B%0A        return _up;%0A    %7D%0A%0A    public Node getDown ()%0A    %7B%0A        return _down;%0A    %7D%0A%0A    public Node getLeft ()%0A    %7B%0A        return _left;%0A    %7D%0A%0A    public Node getRight ()%0A    %7B%0A        return _right;%0A%0A    %7D%0A
     publ

rename some methods for understandability.