Package pfvisualizer.util
Class Node
- java.lang.Object
-
- pfvisualizer.util.Node
-
public class Node extends java.lang.ObjectRepresents a node on the map.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCol()Returns the column coordinate of this node.floatgetHeuristic()Returns the heuristic value of this node.NodegetPrevious()Returns the parent of this node.intgetRow()Returns the row coordinate of this node.voidsetHeuristic(float heuristic)Sets the heuristic value for this node.
-
-
-
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 nodecol- the column coordinate of the nodeprevious- 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
-
-