T - Class of the value.public class ParameterType<T extends org.djunits.value.vdouble.scalar.DoubleScalarInterface> extends AbstractParameterType<T> implements Serializable
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
AbstractParameterType.CheckdefaultValue, valueClass| Constructor and Description |
|---|
ParameterType(String id,
String description,
Class<T> valueClass)
Constructor without default value and check.
|
ParameterType(String id,
String description,
Class<T> valueClass,
AbstractParameterType.Check check)
Constructor without default value, with check.
|
ParameterType(String id,
String description,
Class<T> valueClass,
T defaultValue)
Constructor with default value, without check.
|
ParameterType(String id,
String description,
Class<T> valueClass,
T defaultValue,
AbstractParameterType.Check check)
Constructor with default value and check.
|
| Modifier and Type | Method and Description |
|---|---|
void |
check(T value,
BehavioralCharacteristics bc)
Method to overwrite for checks with constraints.
|
T |
getDefaultValue()
Returns the default value.
|
Class<T> |
getValueClass()
Returns the class of the value.
|
String |
printValue(BehavioralCharacteristics behavioralCharacteristics)
Print the given value from the map in BehavioralCharachteristics in a presentable format.
|
String |
toString() |
checkCheck, equals, getDescription, getId, hasDefaultValue, hashCodepublic ParameterType(String id, String description, Class<T> valueClass)
id - Short name of parameter.description - Parameter description or full name.valueClass - Class of the value.public ParameterType(String id, String description, Class<T> valueClass, T defaultValue)
id - Short name of parameter.description - Parameter description or full name.valueClass - Class of the value.defaultValue - Default value.public ParameterType(String id, String description, Class<T> valueClass, AbstractParameterType.Check check)
id - Short name of parameter.description - Parameter description or full name.valueClass - Class of the value.check - Check for parameter values.public ParameterType(String id, String description, Class<T> valueClass, T defaultValue, AbstractParameterType.Check check)
id - Short name of parameter.description - Parameter description or full name.valueClass - Class of the value.defaultValue - Default value.check - Check for parameter values.public final Class<T> getValueClass()
public void check(T value, BehavioralCharacteristics bc) throws ParameterException
value - Value to check with constraints.bc - Set of behavioral characteristics.ParameterException - If the value does not comply with constraints.public T getDefaultValue() throws ParameterException
getDefaultValue in class AbstractParameterType<T extends org.djunits.value.vdouble.scalar.DoubleScalarInterface>ParameterException - If no default value was set.public final String printValue(BehavioralCharacteristics behavioralCharacteristics) throws ParameterException
printValue in class AbstractParameterType<T extends org.djunits.value.vdouble.scalar.DoubleScalarInterface>behavioralCharacteristics - Behavioral characteristics to get the value from.ParameterException - If the parameter is not present.public String toString()
toString in class AbstractParameterType<T extends org.djunits.value.vdouble.scalar.DoubleScalarInterface>Copyright © 2014–2016 Delft University of Technology. All rights reserved.