Class IntegerCommandParameter
java.lang.Object
org.tweetyproject.plugin.parameter.CommandParameter
org.tweetyproject.plugin.parameter.IntegerCommandParameter
- All Implemented Interfaces:
Cloneable
This parameter holds a number-interval of possible arguments
- Author:
- Bastian Wolf
-
Constructor Summary
ConstructorDescriptionIntegerCommandParameter
(String id, String des) Constructs an `IntegerCommandParameter` with the specified identifier and description.IntegerCommandParameter
(String id, String des, String interval) Constructs an `IntegerCommandParameter` with the specified identifier, description, and interval.IntegerCommandParameter
(String id, String des, Interval<Integer> interval) Constructs an `IntegerCommandParameter` with the specified identifier, description, and interval. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones the objectreturns each possible selection argumentgetValue()
returns the given instantiation argument value for this parameterinstantiates a new parameter iff the given value is valid for this command parameterboolean
checks whether a cli input parameter argument is valid for the called command parametervoid
setInterval
(String interval) sets new selection parametervoid
sets the instantiated parameter argument value, value has to be one of the options contained in selectionsMethods inherited from class org.tweetyproject.plugin.parameter.CommandParameter
getDescription, getIdentifier
-
Constructor Details
-
IntegerCommandParameter
-
IntegerCommandParameter
Constructs an `IntegerCommandParameter` with the specified identifier, description, and interval.- Parameters:
id
- a `String` representing the unique identifier for this parameter.des
- a `String` representing the description of this parameter.interval
- an object specifying the range of valid integer values for this parameter.
-
IntegerCommandParameter
Constructs an `IntegerCommandParameter` with the specified identifier, description, and interval.- Parameters:
id
- a `String` representing the unique identifier for this parameter.des
- a `String` representing the description of this parameter.interval
- a `String` representing the range of valid integer values for this parameter. The string should be in a format that can be parsed
-
-
Method Details
-
setInterval
sets new selection parameter- Parameters:
interval
- some string
-
getInterval
-
getValue
returns the given instantiation argument value for this parameter- Returns:
- the given instantiation argument value for this parameter
-
setValue
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
checks whether a cli input parameter argument is valid for the called command parameter- Specified by:
isValid
in classCommandParameter
- Parameters:
s
- the given input string- Returns:
- true if valid, false if not
-
instantiate
instantiates a new parameter iff the given value is valid for this command parameter- Specified by:
instantiate
in classCommandParameter
- Parameters:
s
- the given argument string- Returns:
- The CommandParameter instance or null if the given string is not valid.
-
clone
Clones the object
-