Record Class LaneChangeInfo

java.lang.Object
java.lang.Record
org.opentrafficsim.road.network.LaneChangeInfo
Record Components:
numberOfLaneChanges - int; required number of lane changes
remainingDistance - Length; remaining distance
deadEnd - boolean; whether the need to change lane comes from a dead-end
lateralDirectionality - LateralDirectionality; lateral directionality of required lane changes
All Implemented Interfaces:
Comparable<LaneChangeInfo>

public record LaneChangeInfo(int numberOfLaneChanges, org.djunits.value.vdouble.scalar.Length remainingDistance, boolean deadEnd, LateralDirectionality lateralDirectionality) extends Record implements Comparable<LaneChangeInfo>
Lane change info.

Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Details

    • LaneChangeInfo

      public LaneChangeInfo(int numberOfLaneChanges, org.djunits.value.vdouble.scalar.Length remainingDistance, boolean deadEnd, LateralDirectionality lateralDirectionality)
      Constructor.
      Parameters:
      numberOfLaneChanges - int; required number of lane changes
      remainingDistance - Length; remaining distance
      deadEnd - boolean; whether the need to change lane comes from a dead-end
      lateralDirectionality - LateralDirectionality; lateral directionality of required lane changes
  • Method Details

    • compareTo

      public int compareTo(LaneChangeInfo o)
      Specified by:
      compareTo in interface Comparable<LaneChangeInfo>
    • 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.
    • numberOfLaneChanges

      public int numberOfLaneChanges()
      Returns the value of the numberOfLaneChanges record component.
      Returns:
      the value of the numberOfLaneChanges record component
    • remainingDistance

      public org.djunits.value.vdouble.scalar.Length remainingDistance()
      Returns the value of the remainingDistance record component.
      Returns:
      the value of the remainingDistance record component
    • deadEnd

      public boolean deadEnd()
      Returns the value of the deadEnd record component.
      Returns:
      the value of the deadEnd record component
    • lateralDirectionality

      public LateralDirectionality lateralDirectionality()
      Returns the value of the lateralDirectionality record component.
      Returns:
      the value of the lateralDirectionality record component