public static class SimpleVariableDeclarations.VariableInitializer
extends java.lang.Object
implements java.io.Serializable
SimpleVariableDeclarations
class and used inside a program
Note that not all variables declared can be initialized!
Particularly variables that have been declared but are never used inside a
program can't be initialized.
Then variable values that are expensive to compute don't have to be computed
if the values are never used inside a program.Constructor and Description |
---|
VariableInitializer() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getVariables()
Returns the set of variable names that can be initialized
|
boolean |
hasVariable(java.lang.String variable)
Returns whether the
SimpleVariableDeclarations.VariableInitializer contains the variable |
void |
setBoolean(java.lang.String name,
boolean value)
Sets the value of a boolean variable
|
void |
setDouble(java.lang.String name,
double value)
Sets the value of a double variable
|
void |
setString(java.lang.String name,
java.lang.String value)
Sets the value of a string variable
|
public java.util.Set<java.lang.String> getVariables()
public boolean hasVariable(java.lang.String variable)
SimpleVariableDeclarations.VariableInitializer
contains the variablevariable
- name of the variablepublic void setBoolean(java.lang.String name, boolean value)
name
- name of the boolean variablevalue
- the value the boolean variable will be set topublic void setDouble(java.lang.String name, double value)
name
- the name of the double variablevalue
- the value the double variable will be set topublic void setString(java.lang.String name, java.lang.String value)
name
- the name of the string variablevalue
- the value the string variable will be set to