Record Class PerceivedObject.Kinematics.Record

java.lang.Object
java.lang.Record
org.opentrafficsim.road.gtu.perception.object.PerceivedObject.Kinematics.Record
Record Components:
getDistance - distance
getSpeed - speed
getAcceleration - acceleration
isFacingSameDirection - whether the object is facing the same direction
getOverlap - 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.
  • 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 - distance
      getSpeed - speed
      getAcceleration - acceleration
      isFacingSameDirection - whether the object is facing the same direction
      getOverlap - overlap
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • getDistance

      public org.djunits.value.vdouble.scalar.Length getDistance()
      Returns the value of the getDistance record component.
      Specified by:
      getDistance in interface PerceivedObject.Kinematics
      Returns:
      the value of the getDistance record component
    • getSpeed

      public org.djunits.value.vdouble.scalar.Speed getSpeed()
      Returns the value of the getSpeed record component.
      Specified by:
      getSpeed in interface PerceivedObject.Kinematics
      Returns:
      the value of the getSpeed record component
    • getAcceleration

      public org.djunits.value.vdouble.scalar.Acceleration getAcceleration()
      Returns the value of the getAcceleration record component.
      Specified by:
      getAcceleration in interface PerceivedObject.Kinematics
      Returns:
      the value of the getAcceleration record component
    • isFacingSameDirection

      public boolean isFacingSameDirection()
      Returns the value of the isFacingSameDirection record component.
      Specified by:
      isFacingSameDirection in interface PerceivedObject.Kinematics
      Returns:
      the value of the isFacingSameDirection record component
    • getOverlap

      Returns the value of the getOverlap record component.
      Specified by:
      getOverlap in interface PerceivedObject.Kinematics
      Returns:
      the value of the getOverlap record component