Horus Doc || Java GUI Reference || Doxygen's quick Index  

SaMethodDescription Class Reference

A description of a string addressable method (function) based on information from the registry. More...

List of all members.

Public Methods

 SaMethodDescription (String key)
 Construct a method description for the given key. More...

boolean valid ()
 Indicates whether the description is valid. More...

String className ()
 The name of the class to which the function belongs. More...

String description ()
 The function description. More...

int isStatic ()
 Indicates whether the function is static. More...

int nArgs ()
 The number of arguments of the function. More...

String name ()
 The name of the function. More...

String returnType ()
 The return type of the function. More...

String[] argNames ()
 The names of the function arguments. More...

String[] argTypes ()
 The types of the function arguments. More...

void dump ()
 Dumps the description on OutputStreamArea. More...


Detailed Description

A description of a string addressable method (function) based on information from the registry.


Constructor & Destructor Documentation

SaMethodDescription::SaMethodDescription String    key [inline]
 

Construct a method description for the given key.

00025 {
00026     boolean foundReturn = false; // may not be present in the registry
00027     int i = key.indexOf("::");
00028     if (i == -1)
00029         return;
00030     _className = key.substring(0, i);
00031     _methodKey = key.substring(i+2);
00032     String cKey = "/sasystem/classes/" + _className + "/methods/" + _methodKey;
00033     HxMediatorPeer _mediator = new HxMediatorPeer();
00034     String[] names = _mediator.getValueNames(cKey);
00035     String[] data = _mediator.getValueData(cKey);
00036     _nArgs = 0;
00037     for (i=0 ; i<names.length ; i++) {
00038         if (names[i].compareTo("description") == 0)
00039             _description = data[i];
00040         if (names[i].compareTo("isStatic") == 0)
00041             _isStatic = java.lang.Integer.parseInt(data[i]);
00042         if (names[i].compareTo("nArgs") == 0)
00043             _nArgs = java.lang.Integer.parseInt(data[i]);
00044         if (names[i].compareTo("name") == 0)
00045             _name = data[i];
00046         if (names[i].compareTo("returnType") == 0) {
00047             _returnType = data[i];
00048             foundReturn = true;
00049         }
00050     }
00051     if (! foundReturn) {
00052 //      _returnType = new String("void");
00053         _returnType = _name; // assume it is a constructor
00054     }
00055     _argNames = new String[_nArgs];
00056     for (i=0 ; i<_nArgs ; i++)
00057         _argNames[i] = new String("argument" + java.lang.String.valueOf(i));
00058     _argTypes = new String[_nArgs];
00059     for (i=0 ; i<names.length ; i++) {
00060         int j;
00061         for (j=0 ; j<_nArgs ; j++) {
00062             if (names[i].compareTo("name" + j) == 0)
00063                 _argNames[j] = data[i];
00064         }
00065         for (j=0 ; j<_nArgs ; j++) {
00066             if (names[i].compareTo("type" + j) == 0)
00067                 _argTypes[j] = data[i];
00068         }
00069     }
00070     _valid = true;
00071 }


Member Function Documentation

boolean SaMethodDescription::valid   [inline]
 

Indicates whether the description is valid.

00077 {
00078     return _valid;
00079 }

String SaMethodDescription::className   [inline]
 

The name of the class to which the function belongs.

00085 {
00086     return _className;
00087 }

String SaMethodDescription::description   [inline]
 

The function description.

00093 {
00094     return _description;
00095 }

int SaMethodDescription::isStatic   [inline]
 

Indicates whether the function is static.

00101 {
00102     return _isStatic;
00103 }

int SaMethodDescription::nArgs   [inline]
 

The number of arguments of the function.

00109 {
00110     return _nArgs;
00111 }

String SaMethodDescription::name   [inline]
 

The name of the function.

00117 {
00118     return _name;
00119 }

String SaMethodDescription::returnType   [inline]
 

The return type of the function.

00125 {
00126     return _returnType;
00127 }

String [] SaMethodDescription::argNames   [inline]
 

The names of the function arguments.

00133 {
00134     return _argNames;
00135 }

String [] SaMethodDescription::argTypes   [inline]
 

The types of the function arguments.

00141 {
00142     return _argTypes;
00143 }

void SaMethodDescription::dump   [inline]
 

Dumps the description on OutputStreamArea.

00149 {
00150     OutputStreamArea.println("_description: " + _description);
00151     OutputStreamArea.println("_isStatic: " + _isStatic);
00152     OutputStreamArea.println("_nArgs: " + _nArgs);
00153     OutputStreamArea.println("_name: " + _name);
00154     OutputStreamArea.println("_returnType: " + _returnType);
00155     int i;
00156     for (i=0 ; i<_argNames.length ; i++)
00157         OutputStreamArea.println("_arg" + i + ": " + _argTypes[i] + " " + _argNames[i]);
00158 }


The documentation for this class was generated from the following file:
Generated on Tue Feb 3 14:19:50 2004 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001