Class ContextDelegate

java.lang.Object
com.aquima.interactions.rule.parser.ContextDelegate
All Implemented Interfaces:
IValueSource

public class ContextDelegate extends Object implements IValueSource
This class maps the inference context methods to the IValueSource interface.
Since:
5.0
Author:
O. Kerpershoek
  • Constructor Details

    • ContextDelegate

      public ContextDelegate(InferenceContext context)
      Constructs the context delegate for the specified inference context.
      Parameters:
      context - The inference context for which the delegate should be constructed.
  • Method Details

    • getValue

      public IValue getValue(String name)
      Description copied from interface: IValueSource
      This method will be used to request a single static value. Examples of such values are Defines like
      • PI
      • TODAY
      • VERSION
      IF a THEN 10 IF a THEN 10 ELSE UNKNOWN In the example above this method will be called to request the value of a.
      Specified by:
      getValue in interface IValueSource
      Parameters:
      name - The name of the global value that is requested.
      Returns:
      The value for the specified name.
    • getObject

      public ICompoundValue getObject(String name)
      Description copied from interface: IValueSource
      This method will request an object that is either a singleton object or an active object (from the InstanceStack).
      Specified by:
      getObject in interface IValueSource
      Parameters:
      name - The type name for which the object value is requested.
      Returns:
      Object value for the specified type name.
    • getAllObjects

      public ICompoundValue[] getAllObjects(String name, boolean includeDerivedObjects)
      Description copied from interface: IValueSource
      This method can be used to request all objects of a specified type. When no objects are available for the specified type, an empty array should be returned.
      Specified by:
      getAllObjects in interface IValueSource
      Parameters:
      name - The type name for which all object are requested.
      includeDerivedObjects - Boolean indicating if objects derived from the specified type should also be returned.
      Returns:
      Array containing all objects of the specified type.
    • getNamedObject

      public ICompoundValue getNamedObject(String entityName, String instanceName)
      Description copied from interface: IValueSource
      This method will request an object that is a static instance.
      Specified by:
      getNamedObject in interface IValueSource
      Parameters:
      entityName - The name object the object
      instanceName - The name of the instance
      Returns:
      Object value for the specified type name, null when not known.