Class SimpleVariableDeclarations.VariableInitializer
java.lang.Object
weka.core.expressionlanguage.common.SimpleVariableDeclarations.VariableInitializer
- All Implemented Interfaces:
Serializable
- Enclosing class:
- SimpleVariableDeclarations
public static class SimpleVariableDeclarations.VariableInitializer
extends Object
implements Serializable
A class to initialize variables that have been declared by a
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.- Version:
- $Revision: 1000 $
- Author:
- Benjamin Weber ( benweber at student dot ethz dot ch )
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the set of variable names that can be initializedboolean
hasVariable
(String variable) Returns whether theSimpleVariableDeclarations.VariableInitializer
contains the variablevoid
setBoolean
(String name, boolean value) Sets the value of a boolean variablevoid
Sets the value of a double variablevoid
Sets the value of a string variable
-
Constructor Details
-
VariableInitializer
public VariableInitializer()
-
-
Method Details
-
getVariables
Returns the set of variable names that can be initialized- Returns:
- the set of variable names that can be initialized
-
hasVariable
Returns whether theSimpleVariableDeclarations.VariableInitializer
contains the variable- Parameters:
variable
- name of the variable- Returns:
- whether the variable exists
-
setBoolean
Sets the value of a boolean variable Requires that the variable exists and is of boolean type.- Parameters:
name
- name of the boolean variablevalue
- the value the boolean variable will be set to
-
setDouble
Sets the value of a double variable Requires that the variable exists and is of double type.- Parameters:
name
- the name of the double variablevalue
- the value the double variable will be set to
-
setString
Sets the value of a string variable Requires that the variable exists and is of string type.- Parameters:
name
- the name of the string variablevalue
- the value the string variable will be set to
-