Class SpeedLimitInfo
java.lang.Object
org.opentrafficsim.road.network.speed.SpeedLimitInfo
- All Implemented Interfaces:
Serializable
Class to contain speed info related to various speed limit types. Instances can reflect the current speed limit situation,
some situation ahead, or some situation in the past.
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, Wouter Schakel
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal <T> void
addSpeedInfo
(SpeedLimitType<T> speedLimitType, T speedInfo) Adds or overwrites the speed info of the given speed limit type.final boolean
containsType
(SpeedLimitType<?> speedLimitType) Whether speed info is present for the given speed limit type.final boolean
final <T> T
getSpeedInfo
(SpeedLimitType<T> speedLimitType) Returns the info regarding a specific speed limit type.final int
hashCode()
final void
removeSpeedInfo
(SpeedLimitType<?> speedLimitType) Removes the speed info of given speed limit type.final String
toString()
-
Constructor Details
-
SpeedLimitInfo
public SpeedLimitInfo()
-
-
Method Details
-
addSpeedInfo
Adds or overwrites the speed info of the given speed limit type.- Type Parameters:
T
- class of speed info- Parameters:
speedLimitType
- SpeedLimitType<T>; speed limit type to add info forspeedInfo
- T; info regarding the speed limit type- Throws:
NullPointerException
- if the speed limit type or speed info is null
-
removeSpeedInfo
Removes the speed info of given speed limit type.- Parameters:
speedLimitType
- SpeedLimitType<?>; speed limit type of speed info to remove- Throws:
NullPointerException
- if the speed limit type is null
-
containsType
Whether speed info is present for the given speed limit type.- Parameters:
speedLimitType
- SpeedLimitType<?>; speed limit type- Returns:
- whether speed info is present for the given speed limit type
-
getSpeedInfo
Returns the info regarding a specific speed limit type.- Type Parameters:
T
- class of speed limit type info- Parameters:
speedLimitType
- SpeedLimitType<T>; speed limit type to return info for- Returns:
- the speed limit type info
- Throws:
NullPointerException
- if the speed limit type is nullIllegalStateException
- if the speed limit type is not present
-
hashCode
public final int hashCode() -
equals
-
toString
-