public interface Command
| Modifier and Type | Method and Description |
|---|---|
Command |
execute(PrintWriter writer,
BufferedReader reader)
Execute the command.
|
CommandRunner |
getCommandRunner()
Get the command runner.
|
Context |
getContext()
Get the command context.
|
Command |
getParentCommand()
Get the parent command.
|
<T extends Command> |
getParentCommand(Class<T> clazz)
Get the parent command with the specified class.
|
boolean |
hasParentCommand()
Check if this command has the parent command.
|
<T extends Command> |
hasParentCommand(Class<T> clazz)
Check if this command has the parent command with the specified class.
|
void |
reset()
Reset the command state.
|
void |
setCommandRunner(CommandRunner commandRunner)
Set the command runner.
|
void |
setContext(Context context)
Set the command context.
|
boolean hasParentCommand()
<T extends Command> boolean hasParentCommand(Class<T> clazz)
T - the generic type of the specified class.clazz - the specified class.Command getParentCommand()
<T extends Command> Command getParentCommand(Class<T> clazz)
T - the generic type of the specified class.clazz - the specified class.Context getContext()
void setContext(Context context)
context - the command context.CommandRunner getCommandRunner()
void setCommandRunner(CommandRunner commandRunner)
commandRunner - the command runner.Command execute(PrintWriter writer, BufferedReader reader)
writer - the stream to write the command output.reader - the stream to read the user input.void reset()
Copyright © 2019. All rights reserved.