Class InputParameterFloatScalar<U extends Unit<U>,T extends FloatScalar<U,T>>

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

public class InputParameterFloatScalar<U extends Unit<U>,T extends FloatScalar<U,T>> extends AbstractInputParameterTypedMap<T>
InputParameterFloatScalar: float parameter with a unit. The number and the value are stored in an InputParameterMap as two input variables of type InputFieldFloat (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

    • InputParameterFloatScalar

      public InputParameterFloatScalar(String key, String shortName, String description, T defaultValue, double displayPriority) throws InputParameterException
      Construct a new InputParameterFloatScalar.
      Parameters:
      key - String; unique (within the parent's input parameter map) name of the new InputParameterFloatUnit
      shortName - String; concise description of the input parameter
      description - String; float 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
    • InputParameterFloatScalar

      public InputParameterFloatScalar(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 InputParameterFloatScalar.
      Parameters:
      key - String; unique (within the parent's input parameter map) name of the new InputParameterFloatUnit
      shortName - String; concise description of the input parameter
      description - String; float 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 float
      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
    • InputParameterFloatScalar

      public InputParameterFloatScalar(String key, String shortName, String description, T defaultValue, float minimumValueSI, float maximumValueSI, boolean minIncluded, boolean maxIncluded, String format, double displayPriority) throws InputParameterException
      Construct a new InputParameterFloatScalar.
      Parameters:
      key - String; unique (within the parent's input parameter map) name of the new InputParameterFloatUnit
      shortName - String; concise description of the input parameter
      description - String; float description of the input parameter (may use HTML markup)
      defaultValue - T; the default value of this input parameter
      minimumValueSI - float; the lowest value allowed as input (in SI units)
      maximumValueSI - float; 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 float
      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
    • getFloatParameter

      public InputParameterFloat getFloatParameter()
      Returns:
      the float 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 FloatScalar<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(float, unit)
    • getMinimumValueSI

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

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

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

      public void setMaximumValueSI(float maximumValueSI)
      Parameters:
      maximumValueSI - float; 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 InputParameterFloatScalar<U,T> clone()
      Provide the clone() method to make a deep copy.
      Specified by:
      clone in interface InputParameter<U extends Unit<U>,T extends FloatScalar<U,T>>
      Overrides:
      clone in class AbstractInputParameterTypedMap<T extends FloatScalar<U,T>>
      Returns:
      a deep copy of the InputParameter