Class SelectionCommandParameter
java.lang.Object
org.tweetyproject.plugin.parameter.CommandParameter
org.tweetyproject.plugin.parameter.SelectionCommandParameter
- All Implemented Interfaces:
Cloneable
This class expands the CommandParameter with a selection-array containing
strings the parameter supports
- Author:
- Bastian Wolf
-
Constructor Summary
ConstructorDescriptionSelectionCommandParameter
(String id, String des) Creates a new parameter.SelectionCommandParameter
(String id, String des, String[] selections) Creates a new parameter. -
Method Summary
Modifier and TypeMethodDescriptionclone()
String[]
returns each possible selection argumentgetValue()
returns the given instantiation argument value for this parameterinstantiates a new parameter iff the given value ist valid for this command parameterboolean
checks whether a cli input parameter argument is valid for the called command parametervoid
setSelections
(String[] selections) 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
-
SelectionCommandParameter
Creates a new parameter.- Parameters:
id
- some stringdes
- some string
-
SelectionCommandParameter
Creates a new parameter.- Parameters:
id
- some stringdes
- some stringselections
- some array of string
-
-
Method Details
-
getSelections
returns each possible selection argument- Returns:
- each possible selection argument
-
setSelections
sets new selection parameter- Parameters:
selections
- an array of strings
-
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 ist 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.
-
instantiate
-
clone
-