T - Class of the value.public abstract class AbstractParameterType<T extends org.djunits.value.vdouble.scalar.DoubleScalarInterface> extends org.opentrafficsim.base.Type<AbstractParameterType<?>> 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.
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractParameterType.Check
List of default checks for ParameterTypes.
|
| Modifier and Type | Field and Description |
|---|---|
protected T |
defaultValue
Default value.
|
protected Class<T> |
valueClass
Class of the value.
|
| Modifier | Constructor and Description |
|---|---|
|
AbstractParameterType(String id,
String description,
Class<T> valueClass)
Constructor without default value and check.
|
|
AbstractParameterType(String id,
String description,
Class<T> valueClass,
AbstractParameterType.Check check)
Constructor without default value, with check.
|
|
AbstractParameterType(String id,
String description,
Class<T> valueClass,
T defaultValue)
Constructor with default value, without check.
|
|
AbstractParameterType(String id,
String description,
Class<T> valueClass,
T defaultValue,
AbstractParameterType.Check check)
Constructor with default value and check.
|
protected |
AbstractParameterType(String id,
String description,
Class<T> valueClass,
T defaultValue,
AbstractParameterType.Check check,
boolean hasDefaultValue)
Protected constructor with default value and check, which may check the default value.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkCheck(T value)
Checks the default checks given with the parameter type.
|
boolean |
equals(Object obj) |
abstract Object |
getDefaultValue()
Returns the default value.
|
String |
getDescription()
Returns the parameter description.
|
String |
getId()
Returns the parameter id.
|
boolean |
hasDefaultValue()
Returns whether this parameter type has a default value.
|
int |
hashCode() |
abstract String |
printValue(BehavioralCharacteristics behavioralCharacteristics)
Print the given value from the map in BehavioralCharachteristics in a presentable format.
|
String |
toString() |
protected final Class<T extends org.djunits.value.vdouble.scalar.DoubleScalarInterface> valueClass
protected final T extends org.djunits.value.vdouble.scalar.DoubleScalarInterface defaultValue
public AbstractParameterType(String id, String description, Class<T> valueClass)
id - Short name of parameter.description - Parameter description or full name.valueClass - Class of the value.public AbstractParameterType(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 AbstractParameterType(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 AbstractParameterType(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.protected AbstractParameterType(String id, String description, Class<T> valueClass, T defaultValue, AbstractParameterType.Check check, boolean hasDefaultValue)
id - Short name of parameter.description - Parameter description or full name.valueClass - Class of the value.defaultValue - Default value.check - Check for parameter values.hasDefaultValue - Whether to check the default value for null.public final String getId()
public final String getDescription()
public final boolean hasDefaultValue()
public abstract Object getDefaultValue() throws ParameterException
ParameterException - If no default value was set.protected final void checkCheck(T value) throws ParameterException
value - The value to check.ParameterException - If the value does not comply with constraints.public abstract String printValue(BehavioralCharacteristics behavioralCharacteristics) throws ParameterException
behavioralCharacteristics - Behavioral characteristics to get the value from.ParameterException - If the parameter is not present.Copyright © 2014–2016 Delft University of Technology. All rights reserved.