Class DoubleParameter

All Implemented Interfaces:
Displayable, LimitableParameter, Parameter, SingleParameter, ProvidesScenarioSupportCommand

public class DoubleParameter
extends AbstractLimitableParameter
implements ProvidesScenarioSupportCommand
Parameter that can contain Double/double values.
Version:
2.6.5
Recent revisions:
2.6.5
  • Constructor Details

    • DoubleParameter

      public DoubleParameter​(String name, String description)
      Constructs a new double parameter.
      Parameters:
      name - the name of the parameter.
      description - the description of the parameter.
    • DoubleParameter

      public DoubleParameter​(Double value, String name, String description)
      Constructs a new Double parameter.
      Parameters:
      value - the new Double value of the parameter
      name - the name of the parameter.
      description - the description of the parameter.
    • DoubleParameter

      public DoubleParameter​(Double value, Double min, Double max, String name, String description)
      Constructs a new Double parameter.
      Parameters:
      value - the new Double value. May be null.
      min - the minimum value.
      max - the maximum value.
      name - the name of the parameter.
      description - the description of the parameter.
    • DoubleParameter

      public DoubleParameter​(Double value, Double min, Double max, Double distance, String name, String description)
      Constructs a new Double parameter.
      Parameters:
      value - the new Double value. May be null.
      min - the minimum value.
      max - the maximum value.
      distance - the distance between any two points in the [min, max] interval.
      name - the name of the parameter.
      description - the description of the parameter.
    • DoubleParameter

      public DoubleParameter​(Double value, Double distance, String name, String description)
      Constructs a new Double parameter.
      Parameters:
      value - the new Double value. May be null.
      distance - the distance between any two points in the open interval.
      name - the name of the parameter.
      description - the description of the parameter.
  • Method Details

    • setDouble

      public void setDouble​(Double val)
      Sets this parameter's value.
      Parameters:
      val - a Double value
    • setDouble

      public void setDouble​(double val)
      Sets this parameter's value.
      Parameters:
      val - a double value
    • getDouble

      public Double getDouble()
      Returns the value of this parameter as a Double.
      Returns:
      the value of this parameter as a Double.
    • getMax

      public Comparable<Double> getMax()
      Returns the max defined value of this Double parameter.
      Specified by:
      getMax in interface LimitableParameter
      Returns:
      maximal Double value of this parameter or in general
    • getMin

      public Comparable<Double> getMin()
      Returns the min defined value of this Double parameter.
      Specified by:
      getMin in interface LimitableParameter
      Returns:
      manimal Double value of this parameter or in general
    • isValid

      public boolean isValid()
      Description copied from interface: LimitableParameter
      Returns true if the value is between the minimum and the maximum, false otherwise.
      Specified by:
      isValid in interface LimitableParameter
      Returns:
      true if the value is between the minimum and the maximum, false otherwise.
    • setValue

      public void setValue​(Object value)
      Sets the value of the AttributeParameter.
      Specified by:
      setValue in interface Displayable
      Overrides:
      setValue in class AbstractSingleParameter
      Parameters:
      value - the new value of the AttributeParameter.
    • getValue

      public Object getValue()
      Returns the value of this parameter.
      Specified by:
      getValue in interface Displayable
      Overrides:
      getValue in class AbstractSingleParameter
      Returns:
      the value of this parameter.
    • setMax

      public void setMax​(Double max)
    • setMin

      public void setMin​(Double min)
    • setValuesBallSize

      public void setValuesBallSize​(Double ball)
      Set new intervalue distance.
      Parameters:
      ball - the change-size between two valid values
    • getValuesBall

      public Number getValuesBall()
      Description copied from class: AbstractLimitableParameter
      The closed ball diameter exclusive for the current parameter value, such that

      v(t) = val
      v(t+1) = (val +|- ballDiameter)

      whereas t stands for time point.
      Specified by:
      getValuesBall in class AbstractLimitableParameter
      Returns:
      a Number instance
    • getScenarioCommand

      public String getScenarioCommand()
      Specified by:
      getScenarioCommand in interface ProvidesScenarioSupportCommand
    • getScenarioImports

      public Collection<String> getScenarioImports()
      Specified by:
      getScenarioImports in interface ProvidesScenarioSupportCommand