Record Class PerceivedObject.Kinematics.Overlap.Record
java.lang.Object
java.lang.Record
org.opentrafficsim.road.gtu.perception.object.PerceivedObject.Kinematics.Overlap.Record
- Record Components:
getOverlap- overlapgetOverlapFront- front overlapgetOverlapRear- rear overlapisAhead- whether the object is aheadisBehind- whether the object is behind
- All Implemented Interfaces:
PerceivedObject.Kinematics.Overlap
- Enclosing interface:
- PerceivedObject.Kinematics.Overlap
public static record PerceivedObject.Kinematics.Overlap.Record(Optional<org.djunits.value.vdouble.scalar.Length> getOverlap, Optional<org.djunits.value.vdouble.scalar.Length> getOverlapFront, Optional<org.djunits.value.vdouble.scalar.Length> getOverlapRear, boolean isAhead, boolean isBehind)
extends Record
implements PerceivedObject.Kinematics.Overlap
Record storing overlap information. The three overlap values are either all
null or they all have a
value. In the former case, either of isAhead and isBehind is true.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opentrafficsim.road.gtu.perception.object.PerceivedObject.Kinematics.Overlap
PerceivedObject.Kinematics.Overlap.Record -
Field Summary
Fields inherited from interface org.opentrafficsim.road.gtu.perception.object.PerceivedObject.Kinematics.Overlap
AHEAD, BEHIND -
Constructor Summary
ConstructorsConstructorDescriptionRecord(Optional<org.djunits.value.vdouble.scalar.Length> getOverlap, Optional<org.djunits.value.vdouble.scalar.Length> getOverlapFront, Optional<org.djunits.value.vdouble.scalar.Length> getOverlapRear, boolean isAhead, boolean isBehind) Creates an instance of aRecordrecord class.Record(org.djunits.value.vdouble.scalar.Length getOverlap, org.djunits.value.vdouble.scalar.Length getOverlapFront, org.djunits.value.vdouble.scalar.Length getOverlapRear, boolean isAhead, boolean isBehind) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Optional<org.djunits.value.vdouble.scalar.Length>Returns the value of thegetOverlaprecord component.Optional<org.djunits.value.vdouble.scalar.Length>Returns the value of thegetOverlapFrontrecord component.Optional<org.djunits.value.vdouble.scalar.Length>Returns the value of thegetOverlapRearrecord component.final inthashCode()Returns a hash code value for this object.booleanisAhead()Returns the value of theisAheadrecord component.booleanisBehind()Returns the value of theisBehindrecord 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.PerceivedObject.Kinematics.Overlap
isParallel
-
Constructor Details
-
Record
public Record(org.djunits.value.vdouble.scalar.Length getOverlap, org.djunits.value.vdouble.scalar.Length getOverlapFront, org.djunits.value.vdouble.scalar.Length getOverlapRear, boolean isAhead, boolean isBehind) Constructor.- Parameters:
getOverlap- overlapgetOverlapFront- front overlapgetOverlapRear- rear overlapisAhead- whether the object is aheadisBehind- whether the object is behind- Throws:
NullPointerException- when getOverlapFront or getOverlapRear is null while getOverlap is notIllegalArgumentException- when getOverlapFront or getOverlapRear is not null while getOverlap is nullIllegalArgumentException- if isAhead or isBehind is true while overlap is specified
-
Record
public Record(Optional<org.djunits.value.vdouble.scalar.Length> getOverlap, Optional<org.djunits.value.vdouble.scalar.Length> getOverlapFront, Optional<org.djunits.value.vdouble.scalar.Length> getOverlapRear, boolean isAhead, boolean isBehind) Creates an instance of aRecordrecord class.- Parameters:
getOverlap- the value for thegetOverlaprecord componentgetOverlapFront- the value for thegetOverlapFrontrecord componentgetOverlapRear- the value for thegetOverlapRearrecord componentisAhead- the value for theisAheadrecord componentisBehind- the value for theisBehindrecord component
-
-
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 '=='. -
getOverlap
Returns the value of thegetOverlaprecord component.- Specified by:
getOverlapin interfacePerceivedObject.Kinematics.Overlap- Returns:
- the value of the
getOverlaprecord component
-
getOverlapFront
Returns the value of thegetOverlapFrontrecord component.- Specified by:
getOverlapFrontin interfacePerceivedObject.Kinematics.Overlap- Returns:
- the value of the
getOverlapFrontrecord component
-
getOverlapRear
Returns the value of thegetOverlapRearrecord component.- Specified by:
getOverlapRearin interfacePerceivedObject.Kinematics.Overlap- Returns:
- the value of the
getOverlapRearrecord component
-
isAhead
public boolean isAhead()Returns the value of theisAheadrecord component.- Specified by:
isAheadin interfacePerceivedObject.Kinematics.Overlap- Returns:
- the value of the
isAheadrecord component
-
isBehind
public boolean isBehind()Returns the value of theisBehindrecord component.- Specified by:
isBehindin interfacePerceivedObject.Kinematics.Overlap- Returns:
- the value of the
isBehindrecord component
-