|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ikrs.util.AbstractCommandFactory<C>
public abstract class AbstractCommandFactory<C extends Command>
Constructor Summary | |
---|---|
AbstractCommandFactory()
Create a new command factory. |
Method Summary | |
---|---|
CommandFactory<C> |
getParentFactory()
Get the parent factory for this factory. |
abstract java.util.Set<C> |
getSupportedCommands()
Get a set of all supported commands. |
abstract C |
make(java.lang.String name,
BasicType[] params)
Make a new Command with the given name and params. |
C |
make(java.lang.String name,
java.lang.String[] params)
Make a new Command with the given name and params. |
C |
make(java.lang.String name,
java.lang.String[] params,
int start,
int end)
This is a slight modifiaction of the make( String, String[] ) method; but it accepts some bounds for the array. |
C |
parse(java.lang.String str)
Make a new Command by parsing it from a string. |
void |
setParentFactory(CommandFactory<C> newParent)
Set the parent factory for this factory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractCommandFactory()
Method Detail |
---|
public abstract java.util.Set<C> getSupportedCommands()
getSupportedCommands
in interface CommandFactory<C extends Command>
public CommandFactory<C> getParentFactory()
getParentFactory
in interface CommandFactory<C extends Command>
public void setParentFactory(CommandFactory<C> newParent)
setParentFactory
in interface CommandFactory<C extends Command>
The
- new parent factory or null to clear.public C make(java.lang.String name, java.lang.String[] params) throws UnknownCommandException, CommandStringIncompleteException
make
in interface CommandFactory<C extends Command>
name
- The command's name.params
- The command's params - in string representation.
UnknownCommandException
CommandStringIncompleteException
public abstract C make(java.lang.String name, BasicType[] params) throws UnknownCommandException, CommandStringIncompleteException
make
in interface CommandFactory<C extends Command>
name
- The command's name.params
- The command's params - in BasicType representation.
UnknownCommandException
CommandStringIncompleteException
public C parse(java.lang.String str) throws java.lang.UnsupportedOperationException, UnknownCommandException, CommandStringIncompleteException, java.text.ParseException
parse
in interface CommandFactory<C extends Command>
str
- The string to parse the command from.
java.lang.UnsupportedOperationException
- if the underlying command implementation
does not support parsing.
CommandStringIncompleteException
- If the given String lacks some data at the end.
java.text.ParseException
- If the given String is malformed.
UnknownCommandException
public C make(java.lang.String name, java.lang.String[] params, int start, int end) throws UnknownCommandException, CommandStringIncompleteException
UnknownCommandException
CommandStringIncompleteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |