org.lsst.ccs.utilities.sa
Class CmndProc.Command

java.lang.Object
  extended by org.lsst.ccs.utilities.sa.CmndProc.Command
Enclosing class:
CmndProc

public static class CmndProc.Command
extends Object

Inner class to implement command decoding


Constructor Summary
CmndProc.Command(int count)
          Constructor
 
Method Summary
 void add(String command, int code, String[] help)
          Adds a command to the table
 int code(int index)
          Gets the code for a command, given its index
 int count()
          Gets the number of commands
 void disable(int index)
          Disables a command, given its index
 int find(String command)
          Gets the index of a command, given its name This routine compares the command string with the first part of all the table entries and returns one of the following: index (>= 0) If the command is fully matched CMD_UNKNOWN If the command is not in the table CMD_AMBIG If the command matches more than one entry CMD_AMBIG - 1 - index If the command is partially matched
 int getMaxLeng(String command)
          Gets the maximum length of matching commands
 String[] help(int index)
          Gets the help for a command, given its index
 String name(int index)
          Gets the name of a command, given its index
 void showHelp(int index)
          Shows help for a command, given its index
 void showHelpSumm(String command)
          Shows help summary for matching commands
 void showHelpSumm(String command, int maxLeng)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmndProc.Command

public CmndProc.Command(int count)
Constructor

Method Detail

add

public void add(String command,
                int code,
                String[] help)
Adds a command to the table


count

public int count()
Gets the number of commands


find

public int find(String command)
Gets the index of a command, given its name This routine compares the command string with the first part of all the table entries and returns one of the following: index (>= 0) If the command is fully matched CMD_UNKNOWN If the command is not in the table CMD_AMBIG If the command matches more than one entry CMD_AMBIG - 1 - index If the command is partially matched


disable

public void disable(int index)
Disables a command, given its index


name

public String name(int index)
Gets the name of a command, given its index


code

public int code(int index)
Gets the code for a command, given its index


help

public String[] help(int index)
Gets the help for a command, given its index


showHelp

public void showHelp(int index)
Shows help for a command, given its index


getMaxLeng

public int getMaxLeng(String command)
Gets the maximum length of matching commands


showHelpSumm

public void showHelpSumm(String command)
Shows help summary for matching commands


showHelpSumm

public void showHelpSumm(String command,
                         int maxLeng)


Copyright © 2013 LSST. All Rights Reserved.