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 aSimpleVariableDeclarationsclass 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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VariableInitializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getVariables()Returns the set of variable names that can be initializedbooleanhasVariable(String variable)Returns whether theSimpleVariableDeclarations.VariableInitializercontains the variablevoidsetBoolean(String name, boolean value)Sets the value of a boolean variablevoidsetDouble(String name, double value)Sets the value of a double variablevoidsetString(String name, String value)Sets the value of a string variable
-
-
-
Method Detail
-
getVariables
public Set<String> getVariables()
Returns the set of variable names that can be initialized- Returns:
- the set of variable names that can be initialized
-
hasVariable
public boolean hasVariable(String variable)
Returns whether theSimpleVariableDeclarations.VariableInitializercontains the variable- Parameters:
variable- name of the variable- Returns:
- whether the variable exists
-
setBoolean
public void setBoolean(String name, boolean value)
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
public void setDouble(String name, double value)
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
-
-