Package org.opentrafficsim.base
Interface HierarchicallyTyped<T extends HierarchicalType<T,I>,I extends HierarchicallyTyped<T,I>>
- Type Parameters:
T- The HierarchicalType of the typing objectI- The type of the typed object
public interface HierarchicallyTyped<T extends HierarchicalType<T,I>,I extends HierarchicallyTyped<T,I>>
HierarchicallyTyped is the interface of objects that are of a HierarchicalType. Examples are Gtu (of type GtuType), Link (of
type LinkType), and Detector (of type DetectorType). By making these objects HierarchicallyTyped, they can return their
correct 'type' as well as check whether they belong to a certain hierarchical type.
Copyright (c) 2022-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, Peter Knoppers, Wouter Schakel
-
Method Summary
-
Method Details
-
getType
T getType()Return the assigned type of the typed object.- Returns:
- the assigned type of the typed object
-
isOfType
Return whether the object if has type 'type', or one of the subtypes of 'type'. An example isgtu.isOfType(Types.BUS)orlink.isOfType(Types.HIGHWAY).- Parameters:
type- the type to check against- Returns:
- whether the object if has type 'type', or one of the subtypes of 'type'
-