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:
java.lang.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(java.lang.String id, java.lang.String des)
constructor for the custom string list parameter with id and descriptionCustomStringListCommandParameter(java.lang.String id, java.lang.String des, java.lang.String criteria)
constructor for the custom string list parameter with id, description and criteria
-
Method Summary
Modifier and Type Method Description java.lang.Object
clone()
method to clone this object for instantiationjava.lang.String
getCriteria()
java.lang.String[]
getValue()
CommandParameter
instantiate(java.lang.String s)
instantiate single stringCommandParameter
instantiate(java.lang.String[] s)
instantiates a list of arguments if validboolean
isValid(java.lang.String s)
valid iff string matches criteriavoid
setCriteria(java.lang.String criteria)
void
setValue(java.lang.String[] value)
-
Methods inherited from class net.sf.tweety.plugin.parameter.CommandParameter
getDescription, getIdentifier
-
-
-
-
Constructor Detail
-
CustomStringListCommandParameter
public CustomStringListCommandParameter(java.lang.String id, java.lang.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(java.lang.String id, java.lang.String des, java.lang.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 java.lang.String[] getValue()
- Overrides:
getValue
in classStringListCommandParameter
-
getCriteria
public java.lang.String getCriteria()
-
setValue
public void setValue(java.lang.String[] value)
- Overrides:
setValue
in classStringListCommandParameter
-
setCriteria
public void setCriteria(java.lang.String criteria)
-
isValid
public boolean isValid(java.lang.String s)
valid iff string matches criteria- Overrides:
isValid
in classStringListCommandParameter
- Parameters:
s
- the given input string- Returns:
- true if valid, false if not
-
instantiate
public CommandParameter instantiate(java.lang.String s)
instantiate single string- Overrides:
instantiate
in classStringListCommandParameter
- Parameters:
s
- the given string to instantiate- Returns:
- parameter
-
instantiate
public CommandParameter instantiate(java.lang.String[] s)
instantiates a list of arguments if valid- Overrides:
instantiate
in classStringListCommandParameter
- Parameters:
s
- the given strings array to instantiate- Returns:
- instantiated parameter if input is valid,
-
clone
public java.lang.Object clone()
method to clone this object for instantiation- Overrides:
clone
in classStringListCommandParameter
-
-