Class SpeedLimitType<T>

  • Type Parameters:
    T - Class of speed info that is linked to the speed limit type.
    All Implemented Interfaces:
    java.io.Serializable, Identifiable
    Direct Known Subclasses:
    SpeedLimitTypeSpeed

    public class SpeedLimitType<T>
    extends Type<SpeedLimitType<T>>
    implements java.io.Serializable, Identifiable
    Defines the type of a speed limit, resulting in different behavior.

    Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    Version:
    $Revision$, $LastChangedDate$, by $Author$, initial version Apr 29, 2016
    Author:
    Alexander Verbraeck, Wouter Schakel
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SpeedLimitType​(java.lang.String id, java.lang.Class<T> infoClass)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      java.lang.String getId()
      Returns the id.
      java.lang.Class<T> getInfoClass()
      Returns the class of the info related to this speed limit type.
      int hashCode()
      java.lang.String toString()
      • Methods inherited from class org.opentrafficsim.base.Type

        isType
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SpeedLimitType

        public SpeedLimitType​(java.lang.String id,
                              java.lang.Class<T> infoClass)
        Constructor.
        Parameters:
        id - String; id of this speed limit type, which must be unique
        infoClass - Class<T>; class of the info related to this speed limit type
        Throws:
        java.lang.NullPointerException - if id or info class is null
    • Method Detail

      • getId

        public final java.lang.String getId()
        Returns the id.
        Specified by:
        getId in interface Identifiable
        Returns:
        the id
      • getInfoClass

        public final java.lang.Class<T> getInfoClass()
        Returns the class of the info related to this speed limit type.
        Returns:
        class of the info related to this speed limit type
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object