POGO Java Program


pogo.gene
Class CmdTable

java.lang.Object
  |
  +--pogo.gene.CmdTable

public class CmdTable
extends java.lang.Object
implements PogoDefs

This class is a just a vector containing the Cmd objects, for the PogoClass object.

Version:
$Revision: 1.22 $
Author:
$Author: verdier $

Field Summary
 java.util.Vector vect
          The vector containing the Cmd objects, or the PogoClass object.
 
Fields inherited from interface pogo.gene.PogoDefs
ALREADY_OVERRIDING, ATTR_IMAGE, ATTR_READ, ATTR_READ_WITH_WRITE, ATTR_READ_WRITE, ATTR_SCALAR, ATTR_SPECTRUM, ATTR_WRITE, AttrDataArray, AttrRWtypeArray, AttrTypeArray, authorRes, classDescRes, cppAddAttrib, cppAddCommands, cppExtention, cppFile, cppLang, dataCommands, dataExtention, dataFile, dataStartCmd, dataStartStates, endGeneTag, errDetected, javaAddAttrib, javaAddCommands, javaExtention, javaFile, javaLang, languageRes, NEW_STR, NOT_OVERRIDE, outputFiles, OVERRIDE, pageTitleRes, pogoLang, projectTitleRes, readAttrProto1, readAttrProto2, readAttrProto3, readFile, revisionRes, startGeneTag, STATE, statesDescRes, STATUS, Tango_ALARM, Tango_CLOSE, Tango_CONST_DEV_STRING, Tango_DISABLE, Tango_EXTRACT, Tango_FAULT, Tango_INSERT, Tango_MOVING, Tango_OFF, Tango_ON, Tango_OPEN, Tango_RUNNING, Tango_STANDBY, Tango_TYPE_UNKNOWN, Tango_UNKNOWN, Tango_WARMUP, TangoStatesArray, templateBlock, templateClass, templateClassCmd, templateCmd, templateExecuteCmd, templateFile, writeAttrProto, writeFile
 
Constructor Summary
CmdTable(java.lang.String filename)
          Constructor for Command Table from an input file (.pogo, .cpp or .java).
CmdTable(java.util.Vector v_in)
          Constructor for Command Table from a java.util.Vector class.
 
Method Summary
 void addElement(Cmd cmd)
          Add a new Cmd object to the Vector.
 java.lang.String buildCommandFactoryMethod(int lang)
          Build or Modify the command factory method.
 java.lang.String checkArgsType()
          Check for each command if argin and argout have a correct type.
 Cmd cmdIdx(int idx)
          Return a the command class for an index.
private  void createVirtualStatusCmd()
           
 void getDescriptions(java.lang.String descFile, java.lang.String serverClass, int lang)
          Initilize commands desciption from file
 int size()
          Return the number of elements in the vector.
 java.lang.String toString()
          Build a String including some parameters for all commands.
 java.lang.String toString(int idx)
          Build a String including some parameters for the command at the index.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

vect

public java.util.Vector vect
The vector containing the Cmd objects, or the PogoClass object.
Constructor Detail

CmdTable

public CmdTable(java.util.Vector v_in)
Constructor for Command Table from a java.util.Vector class.
Parameters:
v_in - The input commands vector to be copied.

CmdTable

public CmdTable(java.lang.String filename)
         throws java.io.FileNotFoundException,
                java.lang.SecurityException,
                java.io.IOException,
                PogoException
Constructor for Command Table from an input file (.pogo, .cpp or .java).
Parameters:
filename - Name of the file to read commands list and parameters.
Throws:
java.io.FileNotFoundException - if occured when reading file.
java.lang.SecurityException - if occured when reading file.
java.io.IOException - if occured when reading file.
PogoException - if a synthax error occured when reading file.
Method Detail

createVirtualStatusCmd

private void createVirtualStatusCmd()

addElement

public void addElement(Cmd cmd)
Add a new Cmd object to the Vector.
Parameters:
cmd - New Cmd object to be added.

buildCommandFactoryMethod

public java.lang.String buildCommandFactoryMethod(int lang)
                                           throws PogoException
Build or Modify the command factory method.
Parameters:
lang - Language to be generated.
Returns:
the command factory method core.

getDescriptions

public void getDescriptions(java.lang.String descFile,
                            java.lang.String serverClass,
                            int lang)
                     throws java.io.FileNotFoundException,
                            java.lang.SecurityException,
                            java.io.IOException,
                            PogoException
Initilize commands desciption from file
Parameters:
descFile - Input file name.
serverClass - server class name to check good exec method name..
lang - Input language.
Throws:
java.io.FileNotFoundException - if occured when reading file.
java.lang.SecurityException - if occured when reading file.
java.io.IOException - if occured when reading file.
PogoException - if a synthax error occured when reading file.

checkArgsType

public java.lang.String checkArgsType()
Check for each command if argin and argout have a correct type. If argin or argout has an unknown type, a message is prepeared.
Returns:
the message with command and args unknown.

cmdIdx

public Cmd cmdIdx(int idx)
Return a the command class for an index.
Parameters:
idx - index of the command.
Returns:
the command class for this index.

size

public int size()
Return the number of elements in the vector.
Returns:
the number of elements in the vector.

toString

public java.lang.String toString(int idx)
                          throws PogoException
Build a String including some parameters for the command at the index.
Parameters:
idx - The command's index.
Returns:
A String containing name, class name, argin type and argout type for the command at idx index.
Throws:
PogoException - if the index input parameter is more than the number of commands.

toString

public java.lang.String toString()
Build a String including some parameters for all commands.
Overrides:
toString in class java.lang.Object
Returns:
A String containing name, class name, argin type and argout type for all commands.

POGO Java Program