Package org.opentrafficsim.road.network
Record Class LaneChangeInfo
java.lang.Object
java.lang.Record
org.opentrafficsim.road.network.LaneChangeInfo
- Record Components:
numberOfLaneChanges- required number of lane changesremainingDistance- remaining distancedeadEnd- whether the need to change lane comes from a dead-endlateralDirectionality- 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
ConstructorsConstructorDescriptionLaneChangeInfo(int numberOfLaneChanges, org.djunits.value.vdouble.scalar.Length remainingDistance, boolean deadEnd, LateralDirectionality lateralDirectionality) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintbooleandeadEnd()Returns the value of thedeadEndrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelateralDirectionalityrecord component.intReturns the value of thenumberOfLaneChangesrecord component.org.djunits.value.vdouble.scalar.LengthReturns the value of theremainingDistancerecord component.final StringtoString()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- required number of lane changesremainingDistance- remaining distancedeadEnd- whether the need to change lane comes from a dead-endlateralDirectionality- lateral directionality of required lane changes
-
-
Method Details
-
compareTo
- Specified by:
compareToin 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 thenumberOfLaneChangesrecord component.- Returns:
- the value of the
numberOfLaneChangesrecord component
-
remainingDistance
public org.djunits.value.vdouble.scalar.Length remainingDistance()Returns the value of theremainingDistancerecord component.- Returns:
- the value of the
remainingDistancerecord component
-
deadEnd
public boolean deadEnd()Returns the value of thedeadEndrecord component.- Returns:
- the value of the
deadEndrecord component
-
lateralDirectionality
Returns the value of thelateralDirectionalityrecord component.- Returns:
- the value of the
lateralDirectionalityrecord component
-