Class ParameterTypeClassList<T>
- java.lang.Object
-
- org.opentrafficsim.base.Type<ParameterType<T>>
-
- org.opentrafficsim.base.parameters.ParameterType<List<Class<? extends T>>>
-
- org.opentrafficsim.base.parameters.ParameterTypeClassList<T>
-
- Type Parameters:
T- class, e.g. TacticalPlanner
- All Implemented Interfaces:
Serializable,Identifiable
public class ParameterTypeClassList<T> extends ParameterType<List<Class<? extends T>>>
Parameter type for a list of classes, each of which may need to be present in a constraint set.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 30 jun. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.opentrafficsim.base.parameters.ParameterType
defaultValue
-
-
Constructor Summary
Constructors Constructor Description ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass)Constructor without default value and check.ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass, List<Class<? extends T>> defaultValue)Constructor with default value, without check.ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass, List<Class<? extends T>> defaultValue, Constraint<? super List<Class<? extends T>>> constraint)Constructor with default value and check.ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass, Constraint<? super List<Class<? extends T>>> constraint)Constructor without default value, with check.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Class<List<Class<? extends T>>>getValueClass(Class<T> clazz)Returns a typed class, where the type isList<Class<? extends T>>, such thatParameterTypeClassinstances can easily be created.StringprintValue(Parameters parameters)Print the given value from the map in Parameters in a presentable format.StringtoString()-
Methods inherited from class org.opentrafficsim.base.parameters.ParameterType
check, checkConstraint, equals, getConstraint, getDefaultValue, getDescription, getId, getValueClass, hasDefaultValue, hashCode
-
-
-
-
Constructor Detail
-
ParameterTypeClassList
public ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass)
Constructor without default value and check.- Parameters:
id- String; Short name of parameter.description- String; Parameter description or full name.valueClass- Class<List<Class<? extends T>>>; Class of the value.
-
ParameterTypeClassList
public ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass, List<Class<? extends T>> defaultValue)
Constructor with default value, without check.- Parameters:
id- String; Short name of parameter.description- String; Parameter description or full name.valueClass- Class<List<Class<? extends T>>>; Class of the value.defaultValue- List<Class<? extends T>>; Default value.
-
ParameterTypeClassList
public ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass, Constraint<? super List<Class<? extends T>>> constraint)
Constructor without default value, with check.- Parameters:
id- String; Short name of parameter.description- String; Parameter description or full name.valueClass- Class<List<Class<? extends T>>>; Class of the value.constraint- Constraint<? super List<Class<? extends T>>>; Constraint for parameter values.
-
ParameterTypeClassList
public ParameterTypeClassList(String id, String description, Class<List<Class<? extends T>>> valueClass, List<Class<? extends T>> defaultValue, Constraint<? super List<Class<? extends T>>> constraint)
Constructor with default value and check.- Parameters:
id- String; Short name of parameter.description- String; Parameter description or full name.valueClass- Class<List<Class<? extends T>>>; Class of the value.defaultValue- List<Class<? extends T>>; Default value.constraint- Constraint<? super List<Class<? extends T>>>; Constraint for parameter values.
-
-
Method Detail
-
getValueClass
public static <T> Class<List<Class<? extends T>>> getValueClass(Class<T> clazz)
Returns a typed class, where the type isList<Class<? extends T>>, such thatParameterTypeClassinstances can easily be created.- Type Parameters:
T- constraining class in parameter type, e.g. TacticalPlanner- Parameters:
clazz- Class<T>; class instance- Returns:
- typed class
-
printValue
public String printValue(Parameters parameters) throws ParameterException
Print the given value from the map in Parameters in a presentable format. The default implementation simply returns the output of toString().- Overrides:
printValuein classParameterType<List<Class<? extends T>>>- Parameters:
parameters- Parameters; Parameters to get the value from- Returns:
- String; readable representation of the value
- Throws:
ParameterException- If the parameter is not present
-
-