Package org.graffiti.plugin.parameter
Class IntegerParameter
java.lang.Object
org.graffiti.plugin.parameter.AbstractSingleParameter
org.graffiti.plugin.parameter.AbstractLimitableParameter
org.graffiti.plugin.parameter.IntegerParameter
- All Implemented Interfaces:
Displayable,LimitableParameter,Parameter,SingleParameter,ProvidesScenarioSupportCommand
- Direct Known Subclasses:
LandmarkParameter
public class IntegerParameter extends AbstractLimitableParameter implements ProvidesScenarioSupportCommand
Parameter that can contain
Integer/int values.- Version:
- 2.6.5
- Recent revisions:
- 2.6.5
-
Constructor Summary
Constructors Constructor Description IntegerParameter(Integer value, Integer min, Integer max, Integer distance, String name, String description)Constructs a new Integer parameter.IntegerParameter(Integer value, Integer min, Integer max, String name, String description)Constructs a new Integer parameter.IntegerParameter(Integer value, Integer distance, String name, String description)Constructs a new Integer parameter.IntegerParameter(Integer value, String name, String description)Constructs a new Integer parameter. -
Method Summary
Modifier and Type Method Description IntegergetInteger()Returns the value of this parameter as anInteger.Comparable<Integer>getMax()Returns the maximum of the interval.Comparable<Integer>getMin()Returns the minimum of the interval.StringgetScenarioCommand()Collection<String>getScenarioImports()ObjectgetValue()Returns the value of this parameter.NumbergetValuesBall()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.booleanisValid()Returnstrueif the value is between the minimum and the maximum,falseotherwise.voidsetValue(Object value)Sets the value of theAttributeParameter.voidsetValuesBallSize(Integer ball)Set new intervalue distance.Methods inherited from class org.graffiti.plugin.parameter.AbstractLimitableParameter
toXMLStringMethods inherited from class org.graffiti.plugin.parameter.AbstractSingleParameter
getDescription, getIcon, getImage, getName, isLeftAligned, setDescription, setLeftAligned, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.graffiti.plugin.Displayable
getDescription, getIcon, getName, setDescription
-
Constructor Details
-
IntegerParameter
Constructs a new Integer parameter.- Parameters:
value- the new Integer value. May be null.name- the name of the parameter.description- the description of the parameter.
-
IntegerParameter
Constructs a new Integer parameter.- Parameters:
value- the new Integer value. May be null.min- the minimum value.max- the maximum value.name- the name of the parameter.description- the description of the parameter.
-
IntegerParameter
public IntegerParameter(Integer value, Integer min, Integer max, Integer distance, String name, String description)Constructs a new Integer parameter.- Parameters:
value- the new Integer 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.
-
IntegerParameter
Constructs a new Integer parameter.- Parameters:
value- the new Integer 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
-
getInteger
Returns the value of this parameter as anInteger.- Returns:
- the value of this parameter as an
Integer.
-
getMax
Returns the maximum of the interval.- Specified by:
getMaxin interfaceLimitableParameter- Returns:
- the maximum of the interval.
-
getMin
Returns the minimum of the interval.- Specified by:
getMinin interfaceLimitableParameter- Returns:
- the minimum of the interval.
-
isValid
public boolean isValid()Description copied from interface:LimitableParameterReturnstrueif the value is between the minimum and the maximum,falseotherwise.- Specified by:
isValidin interfaceLimitableParameter- Returns:
trueif the value is between the minimum and the maximum,falseotherwise.
-
setValue
Sets the value of theAttributeParameter.- Specified by:
setValuein interfaceDisplayable- Overrides:
setValuein classAbstractSingleParameter- Parameters:
value- the new value of theAttributeParameter.- Throws:
IllegalArgumentException- thrown ifvalueis not of the correct type.
-
getValue
Returns the value of this parameter.- Specified by:
getValuein interfaceDisplayable- Overrides:
getValuein classAbstractSingleParameter- Returns:
- the value of this parameter.
-
setValuesBallSize
Set new intervalue distance.- Parameters:
ball- the change-size between two valid values
-
getValuesBall
Description copied from class:AbstractLimitableParameterThe 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:
getValuesBallin classAbstractLimitableParameter- Returns:
- a Number instance
-
getScenarioCommand
- Specified by:
getScenarioCommandin interfaceProvidesScenarioSupportCommand
-
getScenarioImports
- Specified by:
getScenarioImportsin interfaceProvidesScenarioSupportCommand
-