Record Class Node
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
FieldsModifier and TypeFieldDescriptionprivate final BoardThe field for theboardrecord component.private final EdgePositionThe field for theedgePositionrecord component.private final intThe field for thegCostrecord component.private final intThe field for thehCostrecord component.private final NodeThe field for theparentrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionNode(Board board, int gCost, int hCost, Node parent, EdgePosition edgePosition) Creates an instance of aNoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionboard()Returns the value of theboardrecord component.Returns the value of theedgePositionrecord component.final booleanIndicates whether some other object is "equal to" this one.(package private) intfCost()intgCost()Returns the value of thegCostrecord component.final inthashCode()Returns a hash code value for this object.inthCost()Returns the value of thehCostrecord component.parent()Returns the value of theparentrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
board
The field for theboardrecord component. -
gCost
private final int gCostThe field for thegCostrecord component. -
hCost
private final int hCostThe field for thehCostrecord component. -
parent
The field for theparentrecord component. -
edgePosition
The field for theedgePositionrecord component.
-
-
Constructor Details
-
Node
Node(Board board, int gCost, int hCost, Node parent, EdgePosition edgePosition) Creates an instance of aNoderecord class.- Parameters:
board- the value for theboardrecord componentgCost- the value for thegCostrecord componenthCost- the value for thehCostrecord componentparent- the value for theparentrecord componentedgePosition- the value for theedgePositionrecord component
-
-
Method Details
-
fCost
int fCost() -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
board
Returns the value of theboardrecord component.- Returns:
- the value of the
boardrecord component
-
gCost
public int gCost()Returns the value of thegCostrecord component.- Returns:
- the value of the
gCostrecord component
-
hCost
public int hCost()Returns the value of thehCostrecord component.- Returns:
- the value of the
hCostrecord component
-
parent
Returns the value of theparentrecord component.- Returns:
- the value of the
parentrecord component
-
edgePosition
Returns the value of theedgePositionrecord component.- Returns:
- the value of the
edgePositionrecord component
-