Interface Type<T extends Type<T>>

Type Parameters:
T - Class of type.
All Known Implementing Classes:
HierarchicalType, ParameterType, ParameterTypeAcceleration, ParameterTypeBoolean, ParameterTypeClass, ParameterTypeDouble, ParameterTypeDuration, ParameterTypeFrequency, ParameterTypeInteger, ParameterTypeLength, ParameterTypeLinearDensity, ParameterTypeNumeric, ParameterTypeSpeed, ParameterTypeString

public interface Type<T extends Type<T>>
Superclass of all sorts of types, for example GtuType, ParameterType, etc. The only method in this class is isType() which should be used to check whether any type object of unknown type, is a specific type. For example: speedLimitType.isType(SpeedLimitType.CURVATURE). Note that it is not safe to use speedLimitType == SpeedLimitType.CURVATURE.

Copyright (c) 2013-2026 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
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    isType(T type)
    Returns whether this type is the same type as the given type.
  • Method Details

    • isType

      default boolean isType(T type)
      Returns whether this type is the same type as the given type. Use this method to check for any kind of type (e.g. GtuType , ParameterType, etc.) whether an instance is a specific instance of the type. For example: speedLimitType.isType(SpeedLimitType.CURVATURE).

      Note that it is not safe to use speedLimitType == SpeedLimitType.CURVATURE.
      Parameters:
      type - type instance to compare to
      Returns:
      whether this type is the same type as the given type