Interface IValueEnvironment

All Known Implementing Classes:
ValueEnvironment

public interface IValueEnvironment
This interface specifies a scoped runtime environment in which scoped-variables can be created and values can be located using current scope first.
Since:
6.0
Author:
F. van der Meer
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This function starts a new scope in which variables can be declared.
    void
    declareVariable(Identifier name, IValue localValue)
    Assigns an identifier to a value, this identifier is created within the current scope and can therefore hide another variable of the same name.
    void
    This function ends the current scope and cleans up all the variables declared within this scope.
    getAllObjectsForType(Identifier typeName, boolean includeDerivedObjects)
    Locates all objects for the specified type name.
    Locates a named object value from the system.
    Locates a value for the specified identifier.
    This function returns the value source which is the rootscope for this expression evaluation.
  • Method Details

    • declareVariable

      void declareVariable(Identifier name, IValue localValue)
      Assigns an identifier to a value, this identifier is created within the current scope and can therefore hide another variable of the same name.
      Parameters:
      name - The name of the identifier.
      localValue - The value of the identifier which should never be null
    • getValue

      IValue getValue(Identifier name)
      Locates a value for the specified identifier. It will look within the current scope and up until it encounters the root scope.
      Parameters:
      name - The name of the identifier.
      Returns:
      The assigned value for the variable which is never null
      Throws:
      ScopeException - When the variable could not be found.
    • getAllObjectsForType

      IListValue getAllObjectsForType(Identifier typeName, boolean includeDerivedObjects)
      Locates all objects for the specified type name. The boolean indicates whether child types are allowed to be part of the resulting list.
      Parameters:
      typeName - The type name of the object to be located.
      includeDerivedObjects - A boolean indicating that child types of the typeName should be part of the resulting list.
      Returns:
      An IListValue object containing all object values. The list should never be null
    • getNamedObjectValue

      IValue getNamedObjectValue(Identifier typeName, Identifier name)
      Locates a named object value from the system. A named object is a special case for which the system can do a lookup.
      Parameters:
      typeName - The type name of the object to look for.
      name - The name of the object (often called static-instance name)
      Returns:
      The object value which is located, it should never be null
      Throws:
      ScopeException - When the named object value could not be located.
    • beginScope

      void beginScope()
      This function starts a new scope in which variables can be declared. It allows for variable hiding until an end scope is called. Which in turn means a cleanup of the current scope.
    • endScope

      void endScope()
      This function ends the current scope and cleans up all the variables declared within this scope. If an end scope is called while there was no begin scope called previously an exception is thrown.
      Throws:
      ScopeException - when more end scopes are called then begin scope calls.
    • getValueSource

      IValueSource getValueSource()
      This function returns the value source which is the rootscope for this expression evaluation.
      Returns:
      The value source object for this expression, this object should never be null.