Record Class PerceivedObject.Kinematics.Record
java.lang.Object
java.lang.Record
org.opentrafficsim.road.gtu.perception.object.PerceivedObject.Kinematics.Record
- Record Components:
getDistance- distancegetSpeed- speedgetAcceleration- accelerationisFacingSameDirection- whether the object is facing the same directiongetOverlap- overlap
- All Implemented Interfaces:
PerceivedObject.Kinematics
- Enclosing interface:
- PerceivedObject.Kinematics
public static record PerceivedObject.Kinematics.Record(org.djunits.value.vdouble.scalar.Length getDistance, org.djunits.value.vdouble.scalar.Speed getSpeed, org.djunits.value.vdouble.scalar.Acceleration getAcceleration, boolean isFacingSameDirection, PerceivedObject.Kinematics.Overlap getOverlap)
extends Record
implements PerceivedObject.Kinematics
Record storing kinematics information.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.perception.object.PerceivedObject.Kinematics
PerceivedObject.Kinematics.Overlap, PerceivedObject.Kinematics.Record -
Constructor Summary
ConstructorsConstructorDescriptionRecord(org.djunits.value.vdouble.scalar.Length getDistance, org.djunits.value.vdouble.scalar.Speed getSpeed, org.djunits.value.vdouble.scalar.Acceleration getAcceleration, boolean isFacingSameDirection, PerceivedObject.Kinematics.Overlap getOverlap) Null checks. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.org.djunits.value.vdouble.scalar.AccelerationReturns the value of thegetAccelerationrecord component.org.djunits.value.vdouble.scalar.LengthReturns the value of thegetDistancerecord component.Returns the value of thegetOverlaprecord component.org.djunits.value.vdouble.scalar.SpeedgetSpeed()Returns the value of thegetSpeedrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisFacingSameDirectionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Record
public Record(org.djunits.value.vdouble.scalar.Length getDistance, org.djunits.value.vdouble.scalar.Speed getSpeed, org.djunits.value.vdouble.scalar.Acceleration getAcceleration, boolean isFacingSameDirection, PerceivedObject.Kinematics.Overlap getOverlap) Null checks.- Parameters:
getDistance- distancegetSpeed- speedgetAcceleration- accelerationisFacingSameDirection- whether the object is facing the same directiongetOverlap- overlap
-
-
Method Details
-
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 '=='. -
getDistance
public org.djunits.value.vdouble.scalar.Length getDistance()Returns the value of thegetDistancerecord component.- Specified by:
getDistancein interfacePerceivedObject.Kinematics- Returns:
- the value of the
getDistancerecord component
-
getSpeed
public org.djunits.value.vdouble.scalar.Speed getSpeed()Returns the value of thegetSpeedrecord component.- Specified by:
getSpeedin interfacePerceivedObject.Kinematics- Returns:
- the value of the
getSpeedrecord component
-
getAcceleration
public org.djunits.value.vdouble.scalar.Acceleration getAcceleration()Returns the value of thegetAccelerationrecord component.- Specified by:
getAccelerationin interfacePerceivedObject.Kinematics- Returns:
- the value of the
getAccelerationrecord component
-
isFacingSameDirection
public boolean isFacingSameDirection()Returns the value of theisFacingSameDirectionrecord component.- Specified by:
isFacingSameDirectionin interfacePerceivedObject.Kinematics- Returns:
- the value of the
isFacingSameDirectionrecord component
-
getOverlap
Returns the value of thegetOverlaprecord component.- Specified by:
getOverlapin interfacePerceivedObject.Kinematics- Returns:
- the value of the
getOverlaprecord component
-