Package net.sf.tweety.plugin.parameter
Class CommandParameter
- java.lang.Object
-
- net.sf.tweety.plugin.parameter.CommandParameter
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
FileListCommandParameter,IntegerCommandParameter,SelectionCommandParameter,StringListCommandParameter
public abstract class CommandParameter extends Object implements Cloneable
This is the abstract basics class for CommandParameter Never leave identifier and description arguments for the constructor empty, they can not be changed afterwards- Author:
- Bastian Wolf
-
-
Constructor Summary
Constructors Constructor Description CommandParameter(String id, String des)non-empty constructor (member variables cannot be changed after construction)
-
Method Summary
Modifier and Type Method Description StringgetDescription()returns the description for this parameterStringgetIdentifier()returns this parameters name (the identifier)abstract CommandParameterinstantiate(String s)instantiate the command with the given argument string if validabstract booleanisValid(String s)Checks, if the given String is a valid argument for this command parameter
-
-
-
Method Detail
-
getIdentifier
public String getIdentifier()
returns this parameters name (the identifier)- Returns:
- this parameters name (the identifier)
-
getDescription
public String getDescription()
returns the description for this parameter- Returns:
- the description for this parameter
-
isValid
public abstract boolean isValid(String s)
Checks, if the given String is a valid argument for this command parameter- Parameters:
s- the given input string- Returns:
- true if valid, false if not
-
instantiate
public abstract CommandParameter instantiate(String s)
instantiate the command with the given argument string if valid- Parameters:
s- the given argument string- Returns:
- The CommandParameter instance or null if the given string is not valid.
-
-