SL-GMS Enterprise RTView Customization

com.sl.gmsjrt
Interface GmsModelVariables


public interface GmsModelVariables

GmsModelVariables is implemented by generated GMS model classes; it provides the methods that data source classes use to get and set GMS dynamic variables.


Method Summary
 java.lang.Object getGmsArrayVar(java.lang.String varname)
          Return the current value of the variable named 'varname'.
 double getGmsDoubleVar(int index)
          Return the double value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.
 double getGmsDoubleVar(java.lang.String varname)
          Return the double value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.
 int getGmsIntVar(int index)
          Return the integer value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.
 int getGmsIntVar(java.lang.String varname)
          Return the integer value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.
 java.lang.String getGmsStringVar(int index)
          Return the String value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.
 java.lang.String getGmsStringVar(java.lang.String varname)
          Return the String value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.
 java.lang.String[] getGmsVarNames()
          Get an array of names of the GMS dynamic variables that are used in the generated model.
 int[] getGmsVarTypes()
          Get an array of types of the GMS dynamic variables that are used in the generated model.
 int getVarIndex(java.lang.String varname)
          Utility method to get var index from its name
 void setGmsArrayVar(java.lang.String varname, java.lang.Object new_array)
          Assign new_array as the value of the variable named 'varname'.
 void setGmsVar(int index, double value)
          Set the value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.
 void setGmsVar(int index, int value)
          Set the value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.
 void setGmsVar(int index, java.lang.String value)
          Set the value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.
 void setGmsVar(java.lang.String varname, double value)
          Set the value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.
 void setGmsVar(java.lang.String varname, int value)
          Set the value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.
 void setGmsVar(java.lang.String varname, java.lang.String value)
          Set the value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.
 void setGmsVarFromString(java.lang.String varname, java.lang.String valueStr)
          Utility method to set string var by name
 void updateVariables()
          Update all variables.
 

Method Detail

getGmsArrayVar

java.lang.Object getGmsArrayVar(java.lang.String varname)
Return the current value of the variable named 'varname'. Returns null if no such value exists. To set or get array elements, cast the returned object to the proper array type (either GmsTabularData, int[], double[], or String[]). Or, if the variable is not GmsTabularData, use the get and set methods in java.lang.reflect.Array.

Parameters:
varname - The name of the variable.

getGmsDoubleVar

double getGmsDoubleVar(int index)
Return the double value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
index - The index of the variable.

getGmsDoubleVar

double getGmsDoubleVar(java.lang.String varname)
Return the double value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
varname - The name of the variable.

getGmsIntVar

int getGmsIntVar(int index)
Return the integer value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
index - The index of the variable.

getGmsIntVar

int getGmsIntVar(java.lang.String varname)
Return the integer value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
varname - The name of the variable.

getGmsStringVar

java.lang.String getGmsStringVar(int index)
Return the String value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
index - The index of the variable.

getGmsStringVar

java.lang.String getGmsStringVar(java.lang.String varname)
Return the String value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
varname - The name of the variable.

getGmsVarNames

java.lang.String[] getGmsVarNames()
Get an array of names of the GMS dynamic variables that are used in the generated model.

Returns:
A String array containing the names.

getGmsVarTypes

int[] getGmsVarTypes()
Get an array of types of the GMS dynamic variables that are used in the generated model. The type codes are G_INTEGER, G_DOUBLE, G_STRING, G_TABLE, G_INTEGER_ARRAY, G_DOUBLE_ARRAY or G_STRING_ARRAY.

Returns:
An int array containing the type codes.

getVarIndex

int getVarIndex(java.lang.String varname)
Utility method to get var index from its name

Parameters:
varname - The name to search for.
Returns:
int the index of the variable, or -1 if not found

setGmsArrayVar

void setGmsArrayVar(java.lang.String varname,
                    java.lang.Object new_array)
Assign new_array as the value of the variable named 'varname'. If the vartype for this varname is G_TABLE, use this method to replace the GmsTabularData. To modify the GmsTabularData, use getGmsArrayVar().

If the vartype for this varname is one of the G_ARRAY types, use this method when it is necessary to replace the entire array, (for example, to change the length of the array). To change individual array elements, see getGmsArrayVar(). The type of new_array must match the type of 'varname', which is either int[], double[], or String[]. Otherwise, the variable is unchanged and an error message is generated.

Parameters:
varname - The name of the variable.
new_array - The value to be assigned to varname.

setGmsVar

void setGmsVar(int index,
               double value)
Set the value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
index - The index of the variable.
value - The new value of the variable.

setGmsVar

void setGmsVar(int index,
               int value)
Set the value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
index - The index of the variable.
value - The new value of the variable.

setGmsVar

void setGmsVar(int index,
               java.lang.String value)
Set the value of the variable at 'index' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
index - The index of the variable.
value - The new value of the variable.

setGmsVar

void setGmsVar(java.lang.String varname,
               double value)
Set the value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
varname - The name of the variable.
value - The new value of the variable.

setGmsVar

void setGmsVar(java.lang.String varname,
               int value)
Set the value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
varname - The name of the variable.
value - The new value of the variable.

setGmsVar

void setGmsVar(java.lang.String varname,
               java.lang.String value)
Set the value of the variable named 'varname' in the getGmsVarNames and getGmsVarTypes arrays.

Parameters:
varname - The name of the variable.
value - The new value of the variable.

setGmsVarFromString

void setGmsVarFromString(java.lang.String varname,
                         java.lang.String valueStr)
Utility method to set string var by name

Parameters:
varname - The name of the variable.
valueStr - The value to assign to the variable in String form.

updateVariables

void updateVariables()
Update all variables. Used in conjunction with the -dsmodel option to the Java Code Generator, to copy variable values from external datasource into the model's local variable set.


SL-GMS Enterprise RTView Customization

Copyright 2009 Sherrill-Lubinski Corporation, 240 Tamal Vista Blvd
Corte Madera, CA 94925, U.S.A. All Rights Reserved