Class Node


  • public class Node
    extends java.lang.Object
    Represents a node on the map.
    • Constructor Summary

      Constructors 
      Constructor Description
      Node​(int row, int col, Node previous)
      Constructs a node that is used in pathfinding.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getCol()
      Returns the column coordinate of this node.
      float getHeuristic()
      Returns the heuristic value of this node.
      Node getPrevious()
      Returns the parent of this node.
      int getRow()
      Returns the row coordinate of this node.
      void setHeuristic​(float heuristic)
      Sets the heuristic value for this node.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Node

        public Node​(int row,
                    int col,
                    Node previous)
        Constructs a node that is used in pathfinding.
        Parameters:
        row - the row coordinate of the node
        col - the column coordinate of the node
        previous - the parent node
    • Method Detail

      • getRow

        public int getRow()
        Returns the row coordinate of this node.
        Returns:
        the row coordinate
      • getCol

        public int getCol()
        Returns the column coordinate of this node.
        Returns:
        the column coordinate
      • getPrevious

        public Node getPrevious()
        Returns the parent of this node.
        Returns:
        the parent node or null if node has no parent
      • getHeuristic

        public float getHeuristic()
        Returns the heuristic value of this node.
        Returns:
        the heuristic value
      • setHeuristic

        public void setHeuristic​(float heuristic)
        Sets the heuristic value for this node.
        Parameters:
        heuristic - the new heuristic value