Package org.opentrafficsim.road.network
Record Class LaneChangeInfo
java.lang.Object
java.lang.Record
org.opentrafficsim.road.network.LaneChangeInfo
- Record Components:
numberOfLaneChanges
- int; required number of lane changesremainingDistance
- Length; remaining distancedeadEnd
- boolean; whether the need to change lane comes from a dead-endlateralDirectionality
- 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 Summary
ConstructorDescriptionLaneChangeInfo
(int numberOfLaneChanges, org.djunits.value.vdouble.scalar.Length remainingDistance, boolean deadEnd, LateralDirectionality lateralDirectionality) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
deadEnd()
Returns the value of thedeadEnd
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thelateralDirectionality
record component.int
Returns the value of thenumberOfLaneChanges
record component.org.djunits.value.vdouble.scalar.Length
Returns the value of theremainingDistance
record component.final String
toString()
Returns a string representation of this record class.
-
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 changesremainingDistance
- Length; remaining distancedeadEnd
- boolean; whether the need to change lane comes from a dead-endlateralDirectionality
- LateralDirectionality; lateral directionality of required lane changes
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<LaneChangeInfo>
-
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 '=='. -
numberOfLaneChanges
public int numberOfLaneChanges()Returns the value of thenumberOfLaneChanges
record component.- Returns:
- the value of the
numberOfLaneChanges
record component
-
remainingDistance
public org.djunits.value.vdouble.scalar.Length remainingDistance()Returns the value of theremainingDistance
record component.- Returns:
- the value of the
remainingDistance
record component
-
deadEnd
public boolean deadEnd()Returns the value of thedeadEnd
record component.- Returns:
- the value of the
deadEnd
record component
-
lateralDirectionality
Returns the value of thelateralDirectionality
record component.- Returns:
- the value of the
lateralDirectionality
record component
-