java.lang.Object
java.lang.Record
com.takenoko.bot.utils.pathfinding.irrigation.Node

record Node(Board board, int gCost, int hCost, Node parent, EdgePosition edgePosition) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Board
    The field for the board record component.
    private final EdgePosition
    The field for the edgePosition record component.
    private final int
    The field for the gCost record component.
    private final int
    The field for the hCost record component.
    private final Node
    The field for the parent record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Node(Board board, int gCost, int hCost, Node parent, EdgePosition edgePosition)
    Creates an instance of a Node record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the board record component.
    Returns the value of the edgePosition record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    (package private) int
     
    int
    Returns the value of the gCost record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the hCost record component.
    Returns the value of the parent record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • board

      private final Board board
      The field for the board record component.
    • gCost

      private final int gCost
      The field for the gCost record component.
    • hCost

      private final int hCost
      The field for the hCost record component.
    • parent

      private final Node parent
      The field for the parent record component.
    • edgePosition

      private final EdgePosition edgePosition
      The field for the edgePosition record component.
  • Constructor Details

    • Node

      Node(Board board, int gCost, int hCost, Node parent, EdgePosition edgePosition)
      Creates an instance of a Node record class.
      Parameters:
      board - the value for the board record component
      gCost - the value for the gCost record component
      hCost - the value for the hCost record component
      parent - the value for the parent record component
      edgePosition - the value for the edgePosition record component
  • Method Details

    • fCost

      int fCost()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • board

      public Board board()
      Returns the value of the board record component.
      Returns:
      the value of the board record component
    • gCost

      public int gCost()
      Returns the value of the gCost record component.
      Returns:
      the value of the gCost record component
    • hCost

      public int hCost()
      Returns the value of the hCost record component.
      Returns:
      the value of the hCost record component
    • parent

      public Node parent()
      Returns the value of the parent record component.
      Returns:
      the value of the parent record component
    • edgePosition

      public EdgePosition edgePosition()
      Returns the value of the edgePosition record component.
      Returns:
      the value of the edgePosition record component