Class 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

public abstract class AbstractInputParameterTypedMap<T> extends AbstractInputParameterMap<T>
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.
Author:
Alexander Verbraeck
See Also:
  • Field Details

    • typedValue

      protected T 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 InputParameterMap
      shortName - String; concise description of the input parameter
      description - String; long description of the input parameter (may use HTML markup)
      defaultTypedValue - T; the default value in the corresponding type
      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

    • setCalculatedValue

      public abstract void setCalculatedValue() throws InputParameterException
      Calculate the calculated value for this parameter entry.
      Throws:
      InputParameterException - when the typed value based on the parameter map cannot be constructed
    • getCalculatedValue

      public T getCalculatedValue() throws InputParameterException
      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

      public T 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 interface InputParameter<SortedMap<String,InputParameter<?,?>>,T>
      Overrides:
      clone in class AbstractInputParameterMap<T>
      Returns:
      a deep copy of the InputParameter