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 Board
The field for theboard
record component.private final EdgePosition
The field for theedgePosition
record component.private final int
The field for thegCost
record component.private final int
The field for thehCost
record component.private final Node
The field for theparent
record component. -
Constructor Summary
ConstructorsConstructorDescriptionNode
(Board board, int gCost, int hCost, Node parent, EdgePosition edgePosition) Creates an instance of aNode
record class. -
Method Summary
Modifier and TypeMethodDescriptionboard()
Returns the value of theboard
record component.Returns the value of theedgePosition
record component.final boolean
Indicates whether some other object is "equal to" this one.(package private) int
fCost()
int
gCost()
Returns the value of thegCost
record component.final int
hashCode()
Returns a hash code value for this object.int
hCost()
Returns the value of thehCost
record component.parent()
Returns the value of theparent
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
board
The field for theboard
record component. -
gCost
private final int gCostThe field for thegCost
record component. -
hCost
private final int hCostThe field for thehCost
record component. -
parent
The field for theparent
record component. -
edgePosition
The field for theedgePosition
record component.
-
-
Constructor Details
-
Node
Node(Board board, int gCost, int hCost, Node parent, EdgePosition edgePosition) Creates an instance of aNode
record class.- Parameters:
board
- the value for theboard
record componentgCost
- the value for thegCost
record componenthCost
- the value for thehCost
record componentparent
- the value for theparent
record componentedgePosition
- the value for theedgePosition
record 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 theboard
record component.- Returns:
- the value of the
board
record component
-
gCost
public int gCost()Returns the value of thegCost
record component.- Returns:
- the value of the
gCost
record component
-
hCost
public int hCost()Returns the value of thehCost
record component.- Returns:
- the value of the
hCost
record component
-
parent
Returns the value of theparent
record component.- Returns:
- the value of the
parent
record component
-
edgePosition
Returns the value of theedgePosition
record component.- Returns:
- the value of the
edgePosition
record component
-