public class Categorization extends Object implements Serializable, Identifiable
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Field and Description |
---|---|
static Categorization |
UNCATEGORIZED
Empty categorization.
|
Constructor and Description |
---|
Categorization(String id,
Class<?> class1,
Class<?>... classes) |
Modifier and Type | Method and Description |
---|---|
boolean |
entails(Class<?> clazz)
Returns whether the categorization contains a class that is, or is a sub type of, the given class.
|
boolean |
equals(Object obj) |
Class<?> |
get(int i)
Returns the i'th class.
|
String |
getId() |
int |
hashCode() |
int |
size()
Returns the number of category classes defined.
|
String |
toString() |
public static final Categorization UNCATEGORIZED
public Categorization(String id, Class<?> class1, Class<?>... classes)
id
- String; Idclass1
- Class<?>; 1st classclasses
- Class<?>...; other classesIllegalArgumentException
- if any class is given multiple timesNullPointerException
- if any input is nullpublic final int size()
public final Class<?> get(int i)
i
- int; index of the classIndexOutOfBoundsException
- if index i is out of boundspublic final String getId()
getId
in interface Identifiable
public final boolean entails(Class<?> clazz)
clazz
- Class<?>; class to checkCopyright © 2014–2019 Delft University of Technology. All rights reserved.