Package net.sf.tweety.plugin.parameter
Class SelectionCommandParameter
- java.lang.Object
 - 
- net.sf.tweety.plugin.parameter.CommandParameter
 - 
- net.sf.tweety.plugin.parameter.SelectionCommandParameter
 
 
 
- 
- All Implemented Interfaces:
 java.lang.Cloneable
public class SelectionCommandParameter extends CommandParameter
This class expands the CommandParameter with a selection-array containing strings the parameter supports- Author:
 - Bastian Wolf
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]selectionsall possible values for this parameter's argumentprivate java.lang.Stringvaluethe value each instantiated needs, has to be in selections 
- 
Constructor Summary
Constructors Constructor Description SelectionCommandParameter(java.lang.String id, java.lang.String des)Creates a new parameter.SelectionCommandParameter(java.lang.String id, java.lang.String des, java.lang.String[] selections)Creates a new parameter. 
- 
Method Summary
Modifier and Type Method Description java.lang.Objectclone()java.lang.String[]getSelections()returns each possible selection argumentjava.lang.StringgetValue()returns the given instantiation argument value for this parameterCommandParameterinstantiate(java.lang.String s)instantiates a new parameter iff the given value ist valid for this command parameterjava.util.ArrayList<CommandParameter>instantiate(java.util.ArrayList<java.lang.String> s)booleanisValid(java.lang.String s)checks whether a cli input parameter argument is valid for the called command parametervoidsetSelections(java.lang.String[] selections)sets new selection parametervoidsetValue(java.lang.String 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 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
SelectionCommandParameter
public SelectionCommandParameter(java.lang.String id, java.lang.String des)Creates a new parameter.- Parameters:
 id- some stringdes- some string
 
- 
SelectionCommandParameter
public SelectionCommandParameter(java.lang.String id, java.lang.String des, java.lang.String[] selections)Creates a new parameter.- Parameters:
 id- some stringdes- some stringselections- some array of string
 
 - 
 
- 
Method Detail
- 
getSelections
public java.lang.String[] getSelections()
returns each possible selection argument- Returns:
 - each possible selection argument
 
 
- 
setSelections
public void setSelections(java.lang.String[] selections)
sets new selection parameter- Parameters:
 selections- an array of strings
 
- 
getValue
public java.lang.String getValue()
returns the given instantiation argument value for this parameter- Returns:
 - the given instantiation argument value for this parameter
 
 
- 
setValue
public void setValue(java.lang.String 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(java.lang.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(java.lang.String s)
instantiates a new parameter iff the given value ist 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.
 
 
- 
instantiate
public java.util.ArrayList<CommandParameter> instantiate(java.util.ArrayList<java.lang.String> s)
 
- 
clone
public java.lang.Object clone()
- Overrides:
 clonein classjava.lang.Object
 
 - 
 
 -