public abstract class AbstractCommand extends java.lang.Object implements java.io.Serializable, java.lang.Comparable<AbstractCommand>
Constructor and Description |
---|
AbstractCommand() |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AbstractCommand o)
Performs comparison just on the name.
|
boolean |
equals(java.lang.Object obj)
Returns true if the object is a command with the same name.
|
void |
execute(java.lang.String[] params)
Executes the command with the given parameters.
|
static AbstractCommand |
getCommand(java.lang.String name)
Locates the command for the given name.
|
static java.util.List<AbstractCommand> |
getCommands()
Returns all available commands.
|
abstract java.lang.String |
getHelp()
Returns the help string (no indentation).
|
abstract java.lang.String |
getName()
Returns the name of the command.
|
SimpleCLIPanel |
getOwner()
Returns the owner.
|
abstract java.lang.String |
getParameterHelp()
Returns the one-liner help string for the parameters.
|
void |
setOwner(SimpleCLIPanel value)
Sets the owner.
|
public void setOwner(SimpleCLIPanel value)
value
- the ownerpublic SimpleCLIPanel getOwner()
public abstract java.lang.String getName()
public abstract java.lang.String getHelp()
public abstract java.lang.String getParameterHelp()
public void execute(java.lang.String[] params) throws java.lang.Exception
params
- the parameters for the commandjava.lang.Exception
- if command failspublic int compareTo(AbstractCommand o)
compareTo
in interface java.lang.Comparable<AbstractCommand>
o
- the other command to compare withgetName()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other object to compare withpublic static java.util.List<AbstractCommand> getCommands()
public static AbstractCommand getCommand(java.lang.String name)
name
- the command to look for