Package net.sf.tweety.plugin.parameter
Class IntegerCommandParameter
- java.lang.Object
-
- net.sf.tweety.plugin.parameter.CommandParameter
-
- net.sf.tweety.plugin.parameter.IntegerCommandParameter
-
- All Implemented Interfaces:
Cloneable
public class IntegerCommandParameter extends CommandParameter
This parameter holds a number-interval of possible arguments- Author:
- Bastian Wolf
-
-
Constructor Summary
Constructors Constructor Description IntegerCommandParameter(String id, String des)IntegerCommandParameter(String id, String des, String interval)IntegerCommandParameter(String id, String des, net.sf.tweety.math.Interval<Integer> interval)
-
Method Summary
Modifier and Type Method Description Objectclone()Clones the objectnet.sf.tweety.math.Interval<Integer>getInterval()returns each possible selection argumentIntegergetValue()returns the given instantiation argument value for this parameterCommandParameterinstantiate(String s)instantiates a new parameter iff the given value is valid for this command parameterbooleanisValid(String s)checks whether a cli input parameter argument is valid for the called command parametervoidsetInterval(String interval)sets new selection parametervoidsetValue(Integer value)sets the instantiated parameter argument value, value has to be one of the options contained in selections-
Methods inherited from class net.sf.tweety.plugin.parameter.CommandParameter
getDescription, getIdentifier
-
-
-
-
Method Detail
-
setInterval
public void setInterval(String interval)
sets new selection parameter- Parameters:
interval- some string
-
getInterval
public net.sf.tweety.math.Interval<Integer> getInterval()
returns each possible selection argument- Returns:
- each possible selection argument
-
getValue
public Integer getValue()
returns the given instantiation argument value for this parameter- Returns:
- the given instantiation argument value for this parameter
-
setValue
public void setValue(Integer value)
sets the instantiated parameter argument value, value has to be one of the options contained in selections- Parameters:
value- the value given as argument value
-
isValid
public boolean isValid(String s)
checks whether a cli input parameter argument is valid for the called command parameter- Specified by:
isValidin classCommandParameter- Parameters:
s- the given input string- Returns:
- true if valid, false if not
-
instantiate
public CommandParameter instantiate(String s)
instantiates a new parameter iff the given value is valid for this command parameter- Specified by:
instantiatein classCommandParameter- Parameters:
s- the given argument string- Returns:
- The CommandParameter instance or null if the given string is not valid.
-
-