weka.core.expressionlanguage.common

## Class SimpleVariableDeclarations

- java.lang.Object
- - weka.core.expressionlanguage.common.SimpleVariableDeclarations

- All Implemented Interfaces:
    java.io.Serializable, VariableDeclarations

      public class SimpleVariableDeclarations
      extends java.lang.Object
      implements 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:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `SimpleVariableDeclarations.VariableInitializer` A class to initialize variables that have been declared by a `SimpleVariableDeclarations` class and used inside a program

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleVariableDeclarations()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addBoolean(java.lang.String name)` Adds a variable declaration for a boolean variable
    `void` | `addDouble(java.lang.String name)` Adds a variable declaration for a double variable
    `void` | `addString(java.lang.String name)` Adds a variable declaration for a string variable
    `SimpleVariableDeclarations.VariableInitializer` | `getInitializer()` Returns an object to initialize the declared variables
    `Node` | `getVariable(java.lang.String name)` Tries to fetch a declared variable
    `boolean` | `hasVariable(java.lang.String name)` Whether the variable is declared

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

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

- - ### Constructor Detail

    - #### SimpleVariableDeclarations

          public SimpleVariableDeclarations()

  - ### Method Detail

    - #### hasVariable

          public boolean hasVariable(java.lang.String name)

      Whether the variable is declared
      Specified by:
        `hasVariable` in interface `VariableDeclarations`
      Parameters:
        `name` - name of the variable being queried
      Returns:
        whether the variable is declared

    - #### getVariable

          public Node getVariable(java.lang.String name)

      Tries to fetch a declared variable
      Specified by:
        `getVariable` in interface `VariableDeclarations`
      Parameters:
        `name` - name of the variable to be fetched
      Returns:
        an AST (abstrac syntax tree) node representing the variable

    - #### addBoolean

          public void addBoolean(java.lang.String name)

      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

          public void addDouble(java.lang.String name)

      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

          public void addString(java.lang.String name)

      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

          public SimpleVariableDeclarations.VariableInitializer getInitializer()

      Returns an object to initialize the declared variables
      Returns:
        an object to initialize the declared variables