|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.scripting.engine.Variable
com.sun.slamd.scripting.general.StringArrayVariable
This class defines a string array variable that holds zero or more string values. It also defines a set of methods for dealing with string array variables:
| Field Summary | |
static java.lang.String |
ADD_VALUE_METHOD_NAME
The name of the method that will be used to add a new value to this array. |
static int |
ADD_VALUE_METHOD_NUMBER
The method number for the "addValue" method. |
static java.lang.String |
ASSIGN_METHOD_NAME
The name of the method that will be used to initialize this array. |
static int |
ASSIGN_METHOD_NUMBER
The method number for the "assign" method. |
static java.lang.String |
CONTAINS_METHOD_NAME
The name of the method that will be used to determine if this method contains the specified value. |
static int |
CONTAINS_METHOD_NUMBER
The method number for the "contains" method. |
static java.lang.String |
FIRST_VALUE_METHOD_NAME
The name of the method that will be used to retrieve the first value from this array. |
static int |
FIRST_VALUE_METHOD_NUMBER
The method number for the "firstValue" method. |
static int |
INDEX_OF_1_METHOD_NUMBER
The method number for the first "indexOf" method. |
static int |
INDEX_OF_2_METHOD_NUMBER
The method number for the second "indexOf" method. |
static java.lang.String |
INDEX_OF_METHOD_NAME
The name of the method that will be used to determine the position of the specified value. |
static java.lang.String |
INSERT_METHOD_NAME
The name of the method that will be used to insert a value into this array. |
static int |
INSERT_METHOD_NUMBER
The method number for the "insert" method. |
static java.lang.String |
IS_EMPTY_METHOD_NAME
The name of the method that will determine if this array is empty. |
static int |
IS_EMPTY_METHOD_NUMBER
The method number for the "isEmpty" method. |
static java.lang.String |
IS_NOT_EMPTY_METHOD_NAME
The name of the method that will determine if this array is not empty. |
static int |
IS_NOT_EMPTY_METHOD_NUMBER
The method number for the "isNotEmpty" method. |
static java.lang.String |
LENGTH_METHOD_NAME
The name of the method that will be used to determine the number of elements in this array. |
static int |
LENGTH_METHOD_NUMBER
The method number for the "length" method. |
static java.lang.String |
NEXT_VALUE_METHOD_NAME
The name of the method that will be used to retrieve the next value from the array. |
static int |
NEXT_VALUE_METHOD_NUMBER
The method number for the "nextValue" method. |
static java.lang.String |
RANDOM_VALUE_METHOD_NAME
The name of the method that will be used to retrive a random value from the array. |
static int |
RANDOM_VALUE_METHOD_NUMBER
the method number for the "randomValue" method. |
static java.lang.String |
REMOVE_ALL_METHOD_NAME
The name of the method that will be used to remove all values from this array. |
static int |
REMOVE_ALL_METHOD_NUMBER
The method number for the "removeAll" method. |
static java.lang.String |
REMOVE_METHOD_NAME
The name of the method that will be used to remove a value from this array. |
static int |
REMOVE_METHOD_NUMBER
The method number for the "remove" method. |
static java.lang.String |
REMOVE_VALUE_AT_METHOD_NAME
The name of the method that will be used to remove the value at the specified position from the array. |
static int |
REMOVE_VALUE_AT_METHOD_NUMBER
The method number for the "removeValueAt" method. |
static java.lang.String |
SET_VALUE_AT_METHOD_NAME
The name of the method that will be used to set the value at the specified position in the array. |
static int |
SET_VALUE_AT_METHOD_NUMBER
The method number for the "setValueAt" method. |
static Method[] |
STRING_ARRAY_VARIABLE_METHODS
The set of methods associated with string array variables. |
static java.lang.String |
STRING_ARRAY_VARIABLE_TYPE
The name that will be used for the data type of string array variables. |
static java.lang.String |
VALUE_AT_METHOD_NAME
The name of the method that will be used to retrieve the value at the specified position in the array. |
static int |
VALUE_AT_METHOD_NUMBER
The method number for the "valueAt" method. |
| Constructor Summary | |
StringArrayVariable()
Creates a new variable with no name, to be used only when creating a variable with Class.newInstance(), and only when
setName() is called after that to set the name. |
|
StringArrayVariable(java.lang.String[] values)
Creates a new string array variable with the specified set of values. |
|
| Method Summary | |
void |
addStringValue(java.lang.String stringValue)
Adds the specified value to this string array. |
void |
assign(Argument argument)
Assigns the value of the provided argument to this variable. |
Variable |
executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
Executes the specified method, using the provided variables as arguments to the method, and makes the return value available to the caller. |
int |
getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the method number for the method that has the specified name and argument types, or -1 if there is no such method. |
Method[] |
getMethods()
Retrieves a list of all methods defined for this variable. |
java.lang.String |
getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the return type for the method with the specified name and argument types. |
java.lang.String[] |
getStringValues()
Retrieves the set of string values associated with this variable. |
java.lang.String |
getValueAsString()
Retrieves a string representation of the value of this argument. |
java.lang.String |
getVariableTypeName()
Retrieves the name of the variable type for this variable. |
boolean |
hasMethod(java.lang.String methodName)
Indicates whether this variable type has a method with the specified name. |
void |
setStringValues(java.lang.String[] stringValues)
Specifies the set of string values for this variable. |
| Methods inherited from class com.sun.slamd.scripting.engine.Variable |
getArgumentAsString, getArgumentType, getArgumentValue, getName, getStatTrackers, isValidIdentifier, setName, startStatTrackers, stopStatTrackers |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String STRING_ARRAY_VARIABLE_TYPE
public static final java.lang.String ADD_VALUE_METHOD_NAME
public static final int ADD_VALUE_METHOD_NUMBER
public static final java.lang.String ASSIGN_METHOD_NAME
public static final int ASSIGN_METHOD_NUMBER
public static final java.lang.String CONTAINS_METHOD_NAME
public static final int CONTAINS_METHOD_NUMBER
public static final java.lang.String FIRST_VALUE_METHOD_NAME
public static final int FIRST_VALUE_METHOD_NUMBER
public static final java.lang.String INDEX_OF_METHOD_NAME
public static final int INDEX_OF_1_METHOD_NUMBER
public static final int INDEX_OF_2_METHOD_NUMBER
public static final java.lang.String INSERT_METHOD_NAME
public static final int INSERT_METHOD_NUMBER
public static final java.lang.String IS_EMPTY_METHOD_NAME
public static final int IS_EMPTY_METHOD_NUMBER
public static final java.lang.String IS_NOT_EMPTY_METHOD_NAME
public static final int IS_NOT_EMPTY_METHOD_NUMBER
public static final java.lang.String LENGTH_METHOD_NAME
public static final int LENGTH_METHOD_NUMBER
public static final java.lang.String NEXT_VALUE_METHOD_NAME
public static final int NEXT_VALUE_METHOD_NUMBER
public static final java.lang.String RANDOM_VALUE_METHOD_NAME
public static final int RANDOM_VALUE_METHOD_NUMBER
public static final java.lang.String REMOVE_METHOD_NAME
public static final int REMOVE_METHOD_NUMBER
public static final java.lang.String REMOVE_ALL_METHOD_NAME
public static final int REMOVE_ALL_METHOD_NUMBER
public static final java.lang.String REMOVE_VALUE_AT_METHOD_NAME
public static final int REMOVE_VALUE_AT_METHOD_NUMBER
public static final java.lang.String SET_VALUE_AT_METHOD_NAME
public static final int SET_VALUE_AT_METHOD_NUMBER
public static final java.lang.String VALUE_AT_METHOD_NAME
public static final int VALUE_AT_METHOD_NUMBER
public static final Method[] STRING_ARRAY_VARIABLE_METHODS
| Constructor Detail |
public StringArrayVariable()
throws ScriptException
Class.newInstance(), and only when
setName() is called after that to set the name.
ScriptException - If a problem occurs while initializing the new
variable.public StringArrayVariable(java.lang.String[] values)
values - The set of values to use for this string array variable.| Method Detail |
public java.lang.String[] getStringValues()
public void setStringValues(java.lang.String[] stringValues)
stringValues - The set of string values for this variable.public void addStringValue(java.lang.String stringValue)
stringValue - The value to add to this string array.public java.lang.String getVariableTypeName()
getVariableTypeName in class Variablepublic Method[] getMethods()
getMethods in class Variablepublic boolean hasMethod(java.lang.String methodName)
hasMethod in class VariablemethodName - The name of the method.
true if this variable has a method with the specified
name, or false if it does not.
public int getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
getMethodNumber in class VariablemethodName - The name of the method.argumentTypes - The list of argument types for the method.
public java.lang.String getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
getReturnTypeForMethod in class VariablemethodName - The name of the method.argumentTypes - The set of argument types for the method.
null if there is
no such method defined.
public Variable executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
throws ScriptException
executeMethod in class VariablelineNumber - The line number of the script in which the method
call occurs.methodNumber - The method number of the method to execute.arguments - The set of arguments to use for the method.
null if it
does not return a value.
ScriptException - If the specified method does not exist, or if a
problem occurs while attempting to execute it.
public void assign(Argument argument)
throws ScriptException
assign in class Variableargument - The argument whose value should be assigned to this
variable.
ScriptException - If a problem occurs while performing the
assignment.public java.lang.String getValueAsString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||