weka.core.expressionlanguage.core

## Interface VariableDeclarations

- All Superinterfaces:
    java.io.Serializable
  All Known Implementing Classes:
    InstancesHelper, NoVariables, SimpleVariableDeclarations, StatsHelper, VariableDeclarationsCompositor

      public interface VariableDeclarations
      extends java.io.Serializable

  Interface to expose variables to a program. It is deliberately kept very simple to give as little constraints as possible to implementations. There is an implied invariant here: ``hasVariable(String)` == true -> `getVariable(String)` != null` `hasVariable(String)` should be pure i.e. have no side effects. Whereas `getVariable(String)` may have side effects. (This is useful for creating variables on the fly in `getVariable(String)`)
  Version:
    $Revision: 1000 $
  Author:
    Benjamin Weber ( benweber at student dot ethz dot ch )

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Node` | `getVariable(java.lang.String name)` Tries to fetch a variable
    `boolean` | `hasVariable(java.lang.String name)` Whether the variable is declared

- - ### Method Detail

    - #### hasVariable

          boolean hasVariable(java.lang.String name)

      Whether the variable is declared
      Parameters:
        `name` - name of the variable being queried
      Returns:
        whether the variable is declared

    - #### getVariable

          Node getVariable(java.lang.String name)

      Tries to fetch a variable Before a variable is fetched it should be checked whether it is declared through `hasVariable(String)`.
      Parameters:
        `name` - name of the variable to be fetched
      Returns:
        an AST (abstract syntax tree) node representing the variable