Class AbstractInputParameterMap<CT>
java.lang.Object
nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameter<SortedMap<String,InputParameter<?,?>>,CT>
nl.tudelft.simulation.dsol.model.inputparameters.AbstractInputParameterMap<CT>
- Type Parameters:
CT
- The calculated type
- All Implemented Interfaces:
Serializable
,Cloneable
,InputParameter<SortedMap<String,
InputParameter<?, ?>>, CT>
- Direct Known Subclasses:
AbstractInputParameterTypedMap
,InputParameterMap
public abstract class AbstractInputParameterMap<CT>
extends AbstractInputParameter<SortedMap<String,InputParameter<?,?>>,CT>
The InputParameterMap contains a number of InputParameters, each of which can also be an InputParameterMap again. The
InputParameterMap provides functions to add and remove sub-parameters, to retrieve sub-parameters based on their key, and to
return a sorted set of InputParameters based on their displayValue.
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
Modifier and TypeClassDescription(package private) class
InputParameterComparator provides the comparator based on the displayPriority of the entries. -
Constructor Summary
ConstructorDescriptionAbstractInputParameterMap
(String key, String shortName, String description, double displayPriority) Construct a new AbstractInputParameterMap. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(AbstractInputParameter<?, ?> inputParameter) Add an input parameter to this map of input parameters.clone()
Provide the clone() method to make a deep copy.InputParameter<?,
?> Gets an input parameter from this map of input parameters.SortedSet<InputParameter<?,
?>> Return a sorted set of sub-parameters of this InputParameterMap.Return a formatted human readable list of keys and values.protected String
printValues
(AbstractInputParameterMap<?> map, int depth) Return a formatted human readable list of keys and values, indented with spaces corresponding to the depth.void
Removes an input parameter from this map of input parameters.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
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nl.tudelft.simulation.dsol.model.inputparameters.InputParameter
getCalculatedValue
-
Constructor Details
-
AbstractInputParameterMap
public AbstractInputParameterMap(String key, String shortName, String description, double displayPriority) Construct a new AbstractInputParameterMap.- 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)displayPriority
- 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
-
add
Add an input parameter to this map of input parameters.- Parameters:
inputParameter
- AbstractInputParameter<?,?>; the input parameter to add- Throws:
InputParameterException
- in case an input parameter with the same key already exists
-
remove
Removes an input parameter from this map of input parameters. The input parameter can point to deeper maps using the dot-notation. E.g., when an InputParameterMap exists in this map with name 'server1', and the server1 map has an input parameter called 'iat', we can remove iat by calling remove("server1.iat");- Parameters:
key
- String; the key of the input parameter to remove- Throws:
InputParameterException
- in case the input parameter with this key does not exist
-
get
Gets an input parameter from this map of input parameters. The input parameter can point to deeper maps using the dot-notation. E.g., when an InputParameterMap exists in this map with name 'server1', and the server1 map has an input parameter called 'iat', we can get the InputParameter iat by calling get("server1.iat");- Parameters:
key
- String; the key of the input parameter to retrieve- Returns:
- the input parameter belonging to the key
- Throws:
InputParameterException
- in case the input parameter with this key does not exist
-
clone
Provide the clone() method to make a deep copy.- Specified by:
clone
in interfaceInputParameter<SortedMap<String,
InputParameter<?, ?>>, CT> - Overrides:
clone
in classAbstractInputParameter<SortedMap<String,
InputParameter<?, ?>>, CT> - Returns:
- a deep copy of the InputParameter
-
getSortedSet
Return a sorted set of sub-parameters of this InputParameterMap.- Returns:
- SortedSet<InputParameter<?>>; a sorted set of sub-parameters of this InputParameterMap
-
printValues
Return a formatted human readable list of keys and values, indented with spaces corresponding to the depth.- Parameters:
map
- AbstractInputParameterMap<?>; the map to displaydepth
- int; the depth of the tree- Returns:
- String; a formatted human readable list of keys and values, indented by depth
-
printValues
Return a formatted human readable list of keys and values.- Returns:
- String; a formatted human readable list of keys and values
-