Class ParameterTypeDouble
java.lang.Object
org.opentrafficsim.base.parameters.ParameterType<T>
org.opentrafficsim.base.parameters.ParameterTypeNumeric<Double>
org.opentrafficsim.base.parameters.ParameterTypeDouble
- All Implemented Interfaces:
Identifiable,Type<ParameterType<Double>>
Wrapper class for double parameters.
Copyright (c) 2013-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Wouter Schakel
-
Field Summary
Fields inherited from class org.opentrafficsim.base.parameters.ParameterType
defaultValue -
Constructor Summary
ConstructorsConstructorDescriptionParameterTypeDouble(String id, String description, double defaultValue) Construct a new ParameterTypeDouble with default value, without check.ParameterTypeDouble(String id, String description, double defaultValue, Constraint<? super Double> constraint) Construct a new ParameterTypeDouble with default value and check.ParameterTypeDouble(String id, String description, Double defaultValue, Constraint<Number> constraint) Construct a new ParameterTypeDouble with default value and check. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringprintValue(Parameters parameters) Print the given value from the map in Parameters in a presentable format.toString()Methods inherited from class org.opentrafficsim.base.parameters.ParameterType
check, checkConstraint, equals, getColumn, getConstraint, getDefaultValue, getDescription, getId, getValueClass, hashCode
-
Constructor Details
-
ParameterTypeDouble
Construct a new ParameterTypeDouble with default value, without check.- Parameters:
id- short name of the new ParameterTypeDoubledescription- parameter description or full name of the new ParameterTypeDoubledefaultValue- the default value of the new ParametertypeDouble
-
ParameterTypeDouble
public ParameterTypeDouble(String id, String description, double defaultValue, Constraint<? super Double> constraint) Construct a new ParameterTypeDouble with default value and check.- Parameters:
id- short name of the new ParameterTypeDoubledescription- parameter description or full name of the new ParameterTypeDoubledefaultValue- the default value of the new ParameterTypeDoubleconstraint- constraint for parameter values
-
ParameterTypeDouble
public ParameterTypeDouble(String id, String description, Double defaultValue, Constraint<Number> constraint) Construct a new ParameterTypeDouble with default value and check.- Parameters:
id- short name of the new ParameterTypeDoubledescription- parameter description or full name of the new ParameterTypeDoubledefaultValue- default value for the new ParameterTypeDoubleconstraint- constraint for parameter values
-
-
Method Details
-
printValue
Description copied from class:ParameterTypePrint the given value from the map in Parameters in a presentable format. The default implementation simply returns the output of toString().- Overrides:
printValuein classParameterType<Double>- Parameters:
parameters- Parameters to get the value from- Returns:
- readable representation of the value
- Throws:
ParameterException- If the parameter is not present
-
toString
- Overrides:
toStringin classParameterType<Double>
-