Class SimpleVariableDeclarations.VariableInitializer
- java.lang.Object
-
- weka.core.expressionlanguage.common.SimpleVariableDeclarations.VariableInitializer
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- SimpleVariableDeclarations
public static class SimpleVariableDeclarations.VariableInitializer extends java.lang.Object implements java.io.SerializableA 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 java.util.Set<java.lang.String>getVariables()Returns the set of variable names that can be initializedbooleanhasVariable(java.lang.String variable)Returns whether theSimpleVariableDeclarations.VariableInitializercontains the variablevoidsetBoolean(java.lang.String name, boolean value)Sets the value of a boolean variablevoidsetDouble(java.lang.String name, double value)Sets the value of a double variablevoidsetString(java.lang.String name, java.lang.String value)Sets the value of a string variable
-
-
-
Method Detail
-
getVariables
public java.util.Set<java.lang.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(java.lang.String variable)
Returns whether theSimpleVariableDeclarations.VariableInitializercontains the variable- Parameters:
variable- name of the variable- Returns:
- whether the variable exists
-
setBoolean
public void setBoolean(java.lang.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(java.lang.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
-
setString
public void setString(java.lang.String name, java.lang.String value)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
-
-