Record Class PerceivedGtu.Maneuver.Record
java.lang.Object
java.lang.Record
org.opentrafficsim.road.gtu.perception.object.PerceivedGtu.Maneuver.Record
- Record Components:
isChangingLeft- whether the GTU is changing lanes to the leftisChangingRight- whether the GTU is changing lanes to the rightgetDeviation- lateral deviation from the lane center line
- All Implemented Interfaces:
PerceivedGtu.Maneuver
- Enclosing interface:
- PerceivedGtu.Maneuver
public static record PerceivedGtu.Maneuver.Record(boolean isChangingLeft, boolean isChangingRight, org.djunits.value.vdouble.scalar.Length getDeviation)
extends Record
implements PerceivedGtu.Maneuver
Record storing signals information.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.perception.object.PerceivedGtu.Maneuver
PerceivedGtu.Maneuver.Record -
Field Summary
Fields inherited from interface org.opentrafficsim.road.gtu.perception.object.PerceivedGtu.Maneuver
NONE -
Constructor Summary
ConstructorsConstructorDescriptionRecord(boolean isChangingLeft, boolean isChangingRight, org.djunits.value.vdouble.scalar.Length getDeviation) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.org.djunits.value.vdouble.scalar.LengthReturns the value of thegetDeviationrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theisChangingLeftrecord component.booleanReturns the value of theisChangingRightrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opentrafficsim.road.gtu.perception.object.PerceivedGtu.Maneuver
getLaneChangeDirection, isChangingLane
-
Constructor Details
-
Record
public Record(boolean isChangingLeft, boolean isChangingRight, org.djunits.value.vdouble.scalar.Length getDeviation) Constructor.- Parameters:
isChangingLeft- whether the GTU is changing lanes to the leftisChangingRight- whether the GTU is changing lanes to the rightgetDeviation- lateral deviation from the lane center line- Throws:
IllegalArgumentException- when bothisChangingLeftandisChangingRightare trueNullPointerException- whengetDeviationisnull
-
-
Method Details
-
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 '=='. -
isChangingLeft
public boolean isChangingLeft()Returns the value of theisChangingLeftrecord component.- Specified by:
isChangingLeftin interfacePerceivedGtu.Maneuver- Returns:
- the value of the
isChangingLeftrecord component
-
isChangingRight
public boolean isChangingRight()Returns the value of theisChangingRightrecord component.- Specified by:
isChangingRightin interfacePerceivedGtu.Maneuver- Returns:
- the value of the
isChangingRightrecord component
-
getDeviation
public org.djunits.value.vdouble.scalar.Length getDeviation()Returns the value of thegetDeviationrecord component.- Specified by:
getDeviationin interfacePerceivedGtu.Maneuver- Returns:
- the value of the
getDeviationrecord component
-