Record Class SolutionDay14.Robot
java.lang.Object
java.lang.Record
com.expedient.adventofcodejade.solutions.year2024.SolutionDay14.Robot
- Enclosing class:
SolutionDay14
public static record SolutionDay14.Robot(Coordinate position, Vector2 velocity, int rowCount, int colCount)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionRobot(Coordinate position, Vector2 velocity, int rowCount, int colCount) Creates an instance of aRobotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcolCount()Returns the value of thecolCountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.position()Returns the value of thepositionrecord component.introwCount()Returns the value of therowCountrecord component.final StringtoString()Returns a string representation of this record class.velocity()Returns the value of thevelocityrecord component.
-
Constructor Details
-
Robot
Creates an instance of aRobotrecord class.- Parameters:
position- the value for thepositionrecord componentvelocity- the value for thevelocityrecord componentrowCount- the value for therowCountrecord componentcolCount- the value for thecolCountrecord component
-
-
Method Details
-
performStep
-
getQuadrant
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
position
Returns the value of thepositionrecord component.- Returns:
- the value of the
positionrecord component
-
velocity
Returns the value of thevelocityrecord component.- Returns:
- the value of the
velocityrecord component
-
rowCount
public int rowCount()Returns the value of therowCountrecord component.- Returns:
- the value of the
rowCountrecord component
-
colCount
public int colCount()Returns the value of thecolCountrecord component.- Returns:
- the value of the
colCountrecord component
-