Package model
Record Class GameModel.Trajectory
java.lang.Object
java.lang.Record
model.GameModel.Trajectory
- Enclosing class:
GameModel
The position and velocity of an actor on an associated _undirected_ edge. RIGHT and DOWN are
considered the "positive" directions.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Trajectory
(double p, double v) Creates an instance of aTrajectory
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static GameModel.Trajectory
final int
hashCode()
Returns a hash code value for this object.double
p()
Returns the value of thep
record component.final String
toString()
Returns a string representation of this record class.double
v()
Returns the value of thev
record component.
-
Field Details
-
p
private final double pThe field for thep
record component. -
v
private final double vThe field for thev
record component.
-
-
Constructor Details
-
Trajectory
private Trajectory(double p, double v) Creates an instance of aTrajectory
record class.- Parameters:
p
- the value for thep
record componentv
- the value for thev
record component
-
-
Method Details
-
fromActor
-
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. All components in this record class are compared with '=='. -
p
public double p()Returns the value of thep
record component.- Returns:
- the value of the
p
record component
-
v
public double v()Returns the value of thev
record component.- Returns:
- the value of the
v
record component
-