Package org.graffiti.plugin.parameter
Class DoubleParameter
java.lang.Object
org.graffiti.plugin.parameter.AbstractSingleParameter
org.graffiti.plugin.parameter.AbstractLimitableParameter
org.graffiti.plugin.parameter.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 Summary
Constructors Constructor Description DoubleParameter(Double value, Double min, Double max, Double distance, String name, String description)
Constructs a new Double parameter.DoubleParameter(Double value, Double min, Double max, String name, String description)
Constructs a new Double parameter.DoubleParameter(Double value, Double distance, String name, String description)
Constructs a new Double parameter.DoubleParameter(Double value, String name, String description)
Constructs a new Double parameter.DoubleParameter(String name, String description)
Constructs a new double parameter. -
Method Summary
Modifier and Type Method Description Double
getDouble()
Returns the value of this parameter as aDouble
.Comparable<Double>
getMax()
Returns the max defined value of this Double parameter.Comparable<Double>
getMin()
Returns the min defined value of this Double parameter.String
getScenarioCommand()
Collection<String>
getScenarioImports()
Object
getValue()
Returns the value of this parameter.Number
getValuesBall()
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.boolean
isValid()
Returnstrue
if the value is between the minimum and the maximum,false
otherwise.void
setDouble(double val)
Sets this parameter's value.void
setDouble(Double val)
Sets this parameter's value.void
setMax(Double max)
void
setMin(Double min)
void
setValue(Object value)
Sets the value of theAttributeParameter
.void
setValuesBallSize(Double ball)
Set new intervalue distance.Methods inherited from class org.graffiti.plugin.parameter.AbstractLimitableParameter
toXMLString
Methods inherited from class org.graffiti.plugin.parameter.AbstractSingleParameter
getDescription, getIcon, getImage, getName, isLeftAligned, setDescription, setLeftAligned, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.graffiti.plugin.Displayable
getDescription, getIcon, getName, setDescription
-
Constructor Details
-
DoubleParameter
Constructs a new double parameter.- Parameters:
name
- the name of the parameter.description
- the description of the parameter.
-
DoubleParameter
Constructs a new Double parameter.- Parameters:
value
- the new Double value of the parametername
- the name of the parameter.description
- the description of the parameter.
-
DoubleParameter
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
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
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
Returns the value of this parameter as aDouble
.- Returns:
- the value of this parameter as a
Double
.
-
getMax
Returns the max defined value of this Double parameter.- Specified by:
getMax
in interfaceLimitableParameter
- Returns:
- maximal Double value of this parameter or in general
-
getMin
Returns the min defined value of this Double parameter.- Specified by:
getMin
in interfaceLimitableParameter
- Returns:
- manimal Double value of this parameter or in general
-
isValid
public boolean isValid()Description copied from interface:LimitableParameter
Returnstrue
if the value is between the minimum and the maximum,false
otherwise.- Specified by:
isValid
in interfaceLimitableParameter
- Returns:
true
if the value is between the minimum and the maximum,false
otherwise.
-
setValue
Sets the value of theAttributeParameter
.- Specified by:
setValue
in interfaceDisplayable
- Overrides:
setValue
in classAbstractSingleParameter
- Parameters:
value
- the new value of theAttributeParameter
.
-
getValue
Returns the value of this parameter.- Specified by:
getValue
in interfaceDisplayable
- Overrides:
getValue
in classAbstractSingleParameter
- Returns:
- the value of this parameter.
-
setMax
-
setMin
-
setValuesBallSize
Set new intervalue distance.- Parameters:
ball
- the change-size between two valid values
-
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 classAbstractLimitableParameter
- Returns:
- a Number instance
-
getScenarioCommand
- Specified by:
getScenarioCommand
in interfaceProvidesScenarioSupportCommand
-
getScenarioImports
- Specified by:
getScenarioImports
in interfaceProvidesScenarioSupportCommand
-