Class InputParameterDoubleScalar<U extends Unit<U>,T extends DoubleScalar<U,T>>

Type Parameters:
U - the unit type
T - the scalar type
All Implemented Interfaces:
Serializable, Cloneable, InputParameter<SortedMap<String,InputParameter<?,?>>,T>

public class InputParameterDoubleScalar<U extends Unit<U>,T extends DoubleScalar<U,T>> extends AbstractInputParameterTypedMap<T>
InputParameterDoubleScalar: double parameter with a unit. The number and the value are stored in an InputParameterMap as two input variables of type InputFieldDouble (name: value), and InputFieldUnit (name: unit).

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

    • InputParameterDoubleScalar

      public InputParameterDoubleScalar(String key, String shortName, String description, T defaultValue, double displayPriority) throws InputParameterException
      Construct a new InputParameterDoubleScalar.
      Parameters:
      key - String; unique (within the parent's input parameter map) name of the new InputParameterDoubleUnit
      shortName - String; concise description of the input parameter
      description - String; double description of the input parameter (may use HTML markup)
      defaultValue - T; the default value of this input parameter
      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
      InputParameterException - when unit for the default value cannot be found in the unit definition
    • InputParameterDoubleScalar

      public InputParameterDoubleScalar(String key, String shortName, String description, T defaultValue, T minimumValue, T maximumValue, boolean minIncluded, boolean maxIncluded, String format, double displayPriority) throws InputParameterException
      Construct a new InputParameterDoubleScalar.
      Parameters:
      key - String; unique (within the parent's input parameter map) name of the new InputParameterDoubleUnit
      shortName - String; concise description of the input parameter
      description - String; double description of the input parameter (may use HTML markup)
      defaultValue - T; the default value of this input parameter
      minimumValue - T; the lowest value allowed as input
      maximumValue - T; the highest value allowed as input
      minIncluded - boolean; is the minimum value included or excluded in the allowed interval?
      maxIncluded - boolean; is the maximum value included or excluded in the allowed interval?
      format - String; the format to use in displaying the double
      displayPriority - double; sorting order when properties are displayed to the user
      Throws:
      NullPointerException - when key, shortName, defaultValue, description, format, minimumValue, maximumValue, or defaultValue is null
      IllegalArgumentException - when displayPriority is NaN
      InputParameterException - when unit for the default value cannot be found in the unit definition
    • InputParameterDoubleScalar

      public InputParameterDoubleScalar(String key, String shortName, String description, T defaultValue, double minimumValueSI, double maximumValueSI, boolean minIncluded, boolean maxIncluded, String format, double displayPriority) throws InputParameterException
      Construct a new InputParameterDoubleScalar.
      Parameters:
      key - String; unique (within the parent's input parameter map) name of the new InputParameterDoubleUnit
      shortName - String; concise description of the input parameter
      description - String; double description of the input parameter (may use HTML markup)
      defaultValue - T; the default value of this input parameter
      minimumValueSI - double; the lowest value allowed as input (in SI units)
      maximumValueSI - double; the highest value allowed as input (in SI units)
      minIncluded - boolean; is the minimum value included or excluded in the allowed interval?
      maxIncluded - boolean; is the maximum value included or excluded in the allowed interval?
      format - String; the format to use in displaying the double
      displayPriority - double; sorting order when properties are displayed to the user
      Throws:
      NullPointerException - when key, shortName, defaultValue, description, format, or defaultValue is null
      IllegalArgumentException - when displayPriority is NaN
      InputParameterException - when unit for the default value cannot be found in the unit definition
  • Method Details

    • getUnitParameter

      public InputParameterUnit<U> getUnitParameter()
      Returns:
      the unit sub-parameter
      Throws:
      RuntimeException - when parameter map has been corrupted and no unit parameter can be found
    • getDoubleParameter

      public InputParameterDouble getDoubleParameter()
      Returns:
      the double sub-parameter
      Throws:
      RuntimeException - when parameter map has been corrupted and no value parameter can be found
    • setCalculatedValue

      public void setCalculatedValue() throws InputParameterException
      Construct the scalar value with reflection, and set it as the current value. The unit is specified as Unit<?> because the input using fields cannot guarantee conformance to the right unit type.
      Specified by:
      setCalculatedValue in class AbstractInputParameterTypedMap<T extends DoubleScalar<U,T>>
      Throws:
      InputParameterException - when an operation is attempted that is not compatible with the indicated input parameter, or when the scalar does not have a constructor Scalar(double, unit)
    • getMinimumValueSI

      public Double getMinimumValueSI()
      Returns:
      minimumValue (SI units)
    • setMinimumValueSI

      public void setMinimumValueSI(double minimumValueSI)
      Parameters:
      minimumValueSI - double; set minimumValue (SI units)
    • getMaximumValueSI

      public Double getMaximumValueSI()
      Returns:
      maximumValue (SI units)
    • setMaximumValueSI

      public void setMaximumValueSI(double maximumValueSI)
      Parameters:
      maximumValueSI - double; set maximumValue (SI units)
    • isMinIncluded

      public boolean isMinIncluded()
      Returns:
      minIncluded
    • setMinIncluded

      public void setMinIncluded(boolean minIncluded)
      Parameters:
      minIncluded - boolean; set minIncluded
    • isMaxIncluded

      public boolean isMaxIncluded()
      Returns:
      maxIncluded
    • setMaxIncluded

      public void setMaxIncluded(boolean maxIncluded)
      Parameters:
      maxIncluded - boolean; set maxIncluded
    • clone

      public InputParameterDoubleScalar<U,T> clone()
      Provide the clone() method to make a deep copy.
      Specified by:
      clone in interface InputParameter<U extends Unit<U>,T extends DoubleScalar<U,T>>
      Overrides:
      clone in class AbstractInputParameterTypedMap<T extends DoubleScalar<U,T>>
      Returns:
      a deep copy of the InputParameter