Package net.sf.tweety.plugin.parameter
Class CustomStringListCommandParameter
- java.lang.Object
-
- net.sf.tweety.plugin.parameter.CommandParameter
-
- net.sf.tweety.plugin.parameter.StringListCommandParameter
-
- net.sf.tweety.plugin.parameter.CustomStringListCommandParameter
-
- All Implemented Interfaces:
Cloneable
public class CustomStringListCommandParameter extends StringListCommandParameter
This class extends the string list command parameter with functionality to define valid strings with regular expressions.- Author:
- Bastian Wolf
- See Also:
StringListCommandParameter
-
-
Constructor Summary
Constructors Constructor Description CustomStringListCommandParameter(String id, String des)constructor for the custom string list parameter with id and descriptionCustomStringListCommandParameter(String id, String des, String criteria)constructor for the custom string list parameter with id, description and criteria
-
Method Summary
Modifier and Type Method Description Objectclone()method to clone this object for instantiationStringgetCriteria()String[]getValue()CommandParameterinstantiate(String s)instantiate single stringCommandParameterinstantiate(String[] s)instantiates a list of arguments if validbooleanisValid(String s)valid iff string matches criteriavoidsetCriteria(String criteria)voidsetValue(String[] value)-
Methods inherited from class net.sf.tweety.plugin.parameter.CommandParameter
getDescription, getIdentifier
-
-
-
-
Constructor Detail
-
CustomStringListCommandParameter
public CustomStringListCommandParameter(String id, String des)
constructor for the custom string list parameter with id and description- Parameters:
id- the identification string of this parameterdes- the description of this parameter
-
CustomStringListCommandParameter
public CustomStringListCommandParameter(String id, String des, String criteria)
constructor for the custom string list parameter with id, description and criteria- Parameters:
id- the identification string of this parameterdes- the description of this parametercriteria- the validation criteria for this parameter
-
-
Method Detail
-
getValue
public String[] getValue()
- Overrides:
getValuein classStringListCommandParameter
-
getCriteria
public String getCriteria()
-
setValue
public void setValue(String[] value)
- Overrides:
setValuein classStringListCommandParameter
-
setCriteria
public void setCriteria(String criteria)
-
isValid
public boolean isValid(String s)
valid iff string matches criteria- Overrides:
isValidin classStringListCommandParameter- Parameters:
s- the given input string- Returns:
- true if valid, false if not
-
instantiate
public CommandParameter instantiate(String s)
instantiate single string- Overrides:
instantiatein classStringListCommandParameter- Parameters:
s- the given string to instantiate- Returns:
- parameter
-
instantiate
public CommandParameter instantiate(String[] s)
instantiates a list of arguments if valid- Overrides:
instantiatein classStringListCommandParameter- Parameters:
s- the given strings array to instantiate- Returns:
- instantiated parameter if input is valid,
-
clone
public Object clone()
method to clone this object for instantiation- Overrides:
clonein classStringListCommandParameter
-
-