Class EvaluationContext

java.lang.Object
com.github.basking2.sdsai.itrex.EvaluationContext

public class EvaluationContext extends Object
  • Constructor Details

  • Method Details

    • functionCall

      public static EvaluationContext functionCall(EvaluationContext ctx, Iterator<?> arguments)
    • set

      public void set(Object key, Object value)
    • update

      public void update(Object key, Object value)
      This is like set, but updates an already existing variable in the scope it is defined in. A call to set will merely set the variable in the current context, and that value will be lost on exit. This is a way to create side-effects, a very not-function practice, but sometimes necessary. If the value is not found to update an exception is thrown
      Parameters:
      key - The key to set.
      value - The value to associate with the key.
    • get

      public Object get(Object key)
    • containsKey

      public boolean containsKey(Object key)
    • register

      public void register(Object name, FunctionInterface<? extends Object> operator)
    • getFunction

      public FunctionInterface<? extends Object> getFunction(Object functionName)
    • setArguments

      public void setArguments(Iterator<?> arguments)
    • getArguments

      public Iterator<?> getArguments()
    • getAllFunctions

      public Set<Object> getAllFunctions()
      Get all functions from this context and all parent contexts.
      Returns:
      A set of all function identifiers that may be individually passed to getFunction(Object).