Class SimpleVariableDeclarations
java.lang.Object
weka.core.expressionlanguage.common.SimpleVariableDeclarations
- All Implemented Interfaces:
Serializable
,VariableDeclarations
A set of customizable variable declarations for primitive types.
- Version:
- $Revision: 1000 $
- Author:
- Benjamin Weber ( benweber at student dot ethz dot ch )
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A class to initialize variables that have been declared by aSimpleVariableDeclarations
class and used inside a program -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBoolean
(String name) Adds a variable declaration for a boolean variablevoid
Adds a variable declaration for a double variablevoid
Adds a variable declaration for a string variableReturns an object to initialize the declared variablesgetVariable
(String name) Tries to fetch a declared variableboolean
hasVariable
(String name) Whether the variable is declared
-
Constructor Details
-
SimpleVariableDeclarations
public SimpleVariableDeclarations()
-
-
Method Details
-
hasVariable
Whether the variable is declared- Specified by:
hasVariable
in interfaceVariableDeclarations
- Parameters:
name
- name of the variable being queried- Returns:
- whether the variable is declared
-
getVariable
Tries to fetch a declared variable- Specified by:
getVariable
in interfaceVariableDeclarations
- Parameters:
name
- name of the variable to be fetched- Returns:
- an AST (abstrac syntax tree) node representing the variable
-
addBoolean
Adds a variable declaration for a boolean variable Requires that the variable hasn't been declared before.- Parameters:
name
- the name of the variable
-
addDouble
Adds a variable declaration for a double variable Requires that the variable hasn't been declared before.- Parameters:
name
- the name of the variable
-
addString
Adds a variable declaration for a string variable Requires that the variable hasn't been declared before.- Parameters:
name
- the name of the variable
-
getInitializer
Returns an object to initialize the declared variables- Returns:
- an object to initialize the declared variables
-