Record Class LanePosition
java.lang.Object
java.lang.Record
org.opentrafficsim.road.network.lane.LanePosition
- Record Components:
lane
- Lane; the lane for the positionposition
- Length; the position on the lane, relative to the cross section link (design line) line, or against it
- All Implemented Interfaces:
Serializable
public record LanePosition(Lane lane, org.djunits.value.vdouble.scalar.Length position)
extends Record
implements Serializable
Store one position and lane of a GTU.
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
- See Also:
-
Constructor Summary
ConstructorDescriptionLanePosition
(Lane lane, org.djunits.value.vdouble.scalar.Length position) Creates an instance of aLanePosition
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final org.djutils.draw.point.OrientedPoint2d
Retrieve the location and direction of the GTU on the lane.final int
hashCode()
Returns a hash code value for this object.lane()
Returns the value of thelane
record component.org.djunits.value.vdouble.scalar.Length
position()
Returns the value of theposition
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
getLocation
public final org.djutils.draw.point.OrientedPoint2d getLocation()Retrieve the location and direction of the GTU on the lane.- Returns:
- OrientedPoint2d; the location and direction of the GTU on the lane
-
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
lane
Returns the value of thelane
record component.- Returns:
- the value of the
lane
record component
-
position
public org.djunits.value.vdouble.scalar.Length position()Returns the value of theposition
record component.- Returns:
- the value of the
position
record component
-