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.
Author:
Alexander Verbraeck
See Also:
  • 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 InputParameterMap
      shortName - String; concise description of the input parameter
      description - 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 null
      IllegalArgumentException - when displayPriority is NaN
  • Method Details

    • add

      public void add(AbstractInputParameter<?,?> inputParameter) throws InputParameterException
      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

      public void remove(String key) throws InputParameterException
      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

      public InputParameter<?,?> get(String key) throws InputParameterException
      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

      public AbstractInputParameterMap<?> clone()
      Provide the clone() method to make a deep copy.
      Specified by:
      clone in interface InputParameter<SortedMap<String,InputParameter<?,?>>,CT>
      Overrides:
      clone in class AbstractInputParameter<SortedMap<String,InputParameter<?,?>>,CT>
      Returns:
      a deep copy of the InputParameter
    • getSortedSet

      public SortedSet<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

      protected String printValues(AbstractInputParameterMap<?> map, int depth)
      Return a formatted human readable list of keys and values, indented with spaces corresponding to the depth.
      Parameters:
      map - AbstractInputParameterMap<?>; the map to display
      depth - int; the depth of the tree
      Returns:
      String; a formatted human readable list of keys and values, indented by depth
    • printValues

      public String printValues()
      Return a formatted human readable list of keys and values.
      Returns:
      String; a formatted human readable list of keys and values