public static class SimpleVariableDeclarations.VariableInitializer extends Object implements 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 |
|---|---|
Set<String> |
getVariables()
Returns the set of variable names that can be initialized
|
boolean |
hasVariable(String variable)
Returns whether the
SimpleVariableDeclarations.VariableInitializer contains the variable |
void |
setBoolean(String name,
boolean value)
Sets the value of a boolean variable
|
void |
setDouble(String name,
double value)
Sets the value of a double variable
|
void |
setString(String name,
String value)
Sets the value of a string variable
|
public Set<String> getVariables()
public boolean hasVariable(String variable)
SimpleVariableDeclarations.VariableInitializer contains the variablevariable - name of the variablepublic void setBoolean(String name, boolean value)
name - name of the boolean variablevalue - the value the boolean variable will be set topublic void setDouble(String name, double value)
name - the name of the double variablevalue - the value the double variable will be set toCopyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.