Class AbstractInputParameterTypedMap<T>
java.lang.Object
nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameter<SortedMap<String,InputParameter<?,?>>,CT>
nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameterMap<T>
nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameterTypedMap<T>
- Type Parameters:
T
- the type that this map should be able to construct or return
- All Implemented Interfaces:
Serializable
,Cloneable
,InputParameter<SortedMap<String,
InputParameter<?, ?>>, T>
- Direct Known Subclasses:
InputParameterDoubleScalar
,InputParameterFloatScalar
The InputParameterTypedMap is a hierarchical input parameter that can return a variable of a certain type. An example is a
scalar where a double value and a unit have to be inputed. The InputParameterTypedMap is then supposed to be able to return
the scalar based on the two sub-values. The same holds, e.g., for a continuous distribution function. The input parameter for
a continuous distribution should be able to return the chosen distribution, but internally it consists of a selection list or
selection map for the distribution, followed by one or more parameters for the chosen distribution, which are stored in an
InputParameterMap.
Copyright (c) 2003-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
Copyright (c) 2003-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
- Author:
- Alexander Verbraeck
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameterMap
AbstractInputParameterMap.InputParameterComparator
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractInputParameterTypedMap
(String key, String shortName, String description, T defaultTypedValue, double displayPriority) Construct a new InputParameterTypedMap. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Provide the clone() method to make a deep copy.Retrieve the calculated value of the input parameter.Return the default value in the corresponding type.abstract void
Calculate the calculated value for this parameter entry.Methods inherited from class nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameterMap
add, get, getSortedSet, printValues, printValues, remove
Methods inherited from class nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameter
getDefaultValue, getDescription, getDisplayPriority, getExtendedKey, getKey, getParent, getShortName, getValue, isReadOnly, setDefaultValue, setParent, setReadOnly, setValue, toString
-
Field Details
-
typedValue
the value based on the input.
-
-
Constructor Details
-
AbstractInputParameterTypedMap
public AbstractInputParameterTypedMap(String key, String shortName, String description, T defaultTypedValue, double displayPriority) Construct a new InputParameterTypedMap.- Parameters:
key
- String; unique (within the parent's input parameter map) name of the new InputParameterMapshortName
- String; concise description of the input parameterdescription
- String; long description of the input parameter (may use HTML markup)defaultTypedValue
- T; the default value in the corresponding typedisplayPriority
- double; sorting order when properties are displayed to the user- Throws:
NullPointerException
- when key, shortName, defaultValue, or description is nullIllegalArgumentException
- when displayPriority is NaN
-
-
Method Details
-
setCalculatedValue
Calculate the calculated value for this parameter entry.- Throws:
InputParameterException
- when the typed value based on the parameter map cannot be constructed
-
getCalculatedValue
Retrieve the calculated value of the input parameter. This is often the same as the value type, except in situations where a sub-map or sub-list calculates a different value. This is, for instance, the case with distribution functions where the parameters are present in a sub-map (the value) and the return type of the value is a distribution function class.- Returns:
- CT; the calculated value of the input parameter
- Throws:
InputParameterException
- when calculation fails
-
getDefaultTypedValue
Return the default value in the corresponding type.- Returns:
- T; defaultTypedValue the default typed value
-
clone
Provide the clone() method to make a deep copy.- Specified by:
clone
in interfaceInputParameter<SortedMap<String,
InputParameter<?, ?>>, T> - Overrides:
clone
in classAbstractInputParameterMap<T>
- Returns:
- a deep copy of the InputParameter
-