-
- All Known Implementing Classes:
CharsFromTool,CharsToTool,CmdFileTool,GrepTool,HelpTool,HistoryTool,OutFileTool,TokensTool,Tool
public interface ITool
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccept(String command, String[] args)Determines if a command is accepted by current tool.voidclose()Closes the tool.StringgetArgumentDescription()To gets the tool's argument description.StringgetCommandName()To gets the tool's command name.StringgetHelpDescription()To gets the tool's help description.voidprintDetailedHelp(PrintStream out)To print the detailed help message.voidprocess(String command, String[] args, PrintStream out)Processes the command.booleanstart(String[] args, PrintStream out)Starts the tool.
-
-
-
Method Detail
-
start
boolean start(String[] args, PrintStream out) throws CommandException
Starts the tool.- Parameters:
args- The arguments required to start the tool.out- The output channel.- Returns:
trueif the tool has been started up successfully;falseotherwise.- Throws:
CommandException
-
close
void close()
Closes the tool.
-
accept
boolean accept(String command, String[] args)
Determines if a command is accepted by current tool.- Parameters:
command- The commandargs- The arguments taken by the command.- Returns:
trueif this is the correct tool for this command;falseotherwise.
-
process
void process(String command, String[] args, PrintStream out) throws CommandException
Processes the command.- Parameters:
command- The command to be processed.args- The arguments taken by the command.out- The output channel.- Throws:
CommandException
-
printDetailedHelp
void printDetailedHelp(PrintStream out)
To print the detailed help message.
-
getCommandName
String getCommandName()
To gets the tool's command name.- Returns:
- The tool's command name.
-
getArgumentDescription
String getArgumentDescription()
To gets the tool's argument description.- Returns:
- The tool's argument description.
-
getHelpDescription
String getHelpDescription()
To gets the tool's help description.- Returns:
- The tool's help description.
-
-