Package org.opentrafficsim.road.od
Class Categorization
java.lang.Object
org.opentrafficsim.road.od.Categorization
- All Implemented Interfaces:
Serializable
,org.djutils.base.Identifiable
A categorization determines for what part of traffic certain demand data is applicable. By default, this is always for a
given origin-destination pair and time period. A categorization adds to this additional segregation. For example, per lane,
per vehicle class, etc.
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, Peter Knoppers, Wouter Schakel
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Returns whether the categorization contains a class that is, or is a sub type of, the given class.final boolean
final Class<?>
get
(int i) Returns the i'th class.final String
getId()
final int
hashCode()
final int
size()
Returns the number of category classes defined.final String
toString()
-
Field Details
-
UNCATEGORIZED
Empty categorization.
-
-
Constructor Details
-
Categorization
- Parameters:
id
- String; Idclass1
- Class<?>; 1st classclasses
- Class<?>...; other classes- Throws:
IllegalArgumentException
- if any class is given multiple timesNullPointerException
- if any input is null
-
-
Method Details
-
size
public final int size()Returns the number of category classes defined.- Returns:
- number of category classes defined
-
get
Returns the i'th class.- Parameters:
i
- int; index of the class- Returns:
- the i'th class
- Throws:
IndexOutOfBoundsException
- if index i is out of bounds
-
getId
- Specified by:
getId
in interfaceorg.djutils.base.Identifiable
- Returns:
- id.
-
entails
Returns whether the categorization contains a class that is, or is a sub type of, the given class.- Parameters:
clazz
- Class<?>; class to check- Returns:
- whether the categorization contains a class that is, or is a sub type of, the given class
-
hashCode
public final int hashCode() -
equals
-
toString
-