All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.antsr.core.ConsoleCommand
java.lang.Object
   |
   +----edu.utah.janos.antsr.core.ConsoleCommand

  Summary

abstract class  ConsoleCommand
     extends java.lang.Object
{
          // Fields 2
     static Hashtable commands;
     private String name;

          // Constructors 1
     public ConsoleCommand();

          // Methods 10
     static void addCommand(String, ConsoleCommand);
     static void addCommandAlias(String, ConsoleCommand);
     static ConsoleCommand findCommand(String);
     static Enumeration getCommands();
     static boolean handleCommand(ConsoleWorker, String[]);

     protected void getAdditionalHelp(ConsoleWorker, String[]);
     abstract String getDescription();
     String getName();
     protected abstract boolean handle(ConsoleWorker, String[]);
     public String toString();

          // Inner Classes 1
     static class ConsoleCommand.Alias
}

A base class for any commands available in the console.


  Cross Reference

Extended By:
ConsoleWorker.AppCommand, ConsoleWorker.DebugCommand, ConsoleWorker.ExitCommand, ConsoleWorker.GarbageCollectCommand, ConsoleWorker.HelpCommand, ConsoleWorker.InfoCommand, ConsoleWorker.ShutdownCommand, ConsoleWorker.UptimeCommand

Returned By:
ConsoleCommand.Alias.getCommand(), ConsoleCommand.findCommand()





  Fields

· name

Summary  |  Top
   private String name

The name of this command. Set when the command is added to the the table.

See Also: addCommand


· commands

Summary  |  Top
   static Hashtable commands

The table of available commands


  Constructors

· ConsoleCommand

Summary  |  Top

   public ConsoleCommand() 

Default constructor



  Methods

· getDescription

Summary  |  Top
   abstract String getDescription() 

Return a description of the command.



· getName

Summary  |  Top
   String getName() 

Return the primary name of this command.



· getAdditionalHelp

Summary  |  Top
   protected void getAdditionalHelp(ConsoleWorker cw, 
                                    String[] args) 

Returns additional help based on the given arguments.

args[0] - The help command name args[1] - This command name args[2+] - Arguments that should be described in the context of this command



· handle

Summary  |  Top
   protected abstract boolean handle(ConsoleWorker cw, 
                                     String[] args) 

Handle the command event with the given arguments

args[0] - This command name args[1+] - Arguments to the command



· addCommand

Summary  |  Top
   static void addCommand(String name, 
                          ConsoleCommand cc) 

Add a command indexed by the given name to the table of available commands.



· addCommandAlias

Summary  |  Top
   static void addCommandAlias(String name, 
                               ConsoleCommand cc) 

Add an alias for an existing console command



· getCommands

Summary  |  Top
   static Enumeration getCommands() 

Return the collection of all available commands XXX returns a java.util class.



· findCommand

Summary  |  Top
   static ConsoleCommand findCommand(String name) 

Find the ConsoleCommand object corresponding to the given name



· handleCommand

Summary  |  Top
   static boolean handleCommand(ConsoleWorker cw, 
                                String[] args) 

Handle the command line specified by args.

args[0] - The name of the command args[1+] - Additional arguments to the command



· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7