Package weka.core.expressionlanguage.common

# 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:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VariableInitializer()`

- ## Method Summary

  Modifier and Type
  Method
  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

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VariableInitializer

    public VariableInitializer()

- ## Method Details

  - ### 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 the `SimpleVariableDeclarations.VariableInitializer` contains 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 variable
      `value` - 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 variable
      `value` - the value the double variable will be set to

  - ### setString

    public void setString(String name, 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 variable
      `value` - the value the string variable will be set to