Interface IContextExpression<T>

All Superinterfaces:
IExpression

public interface IContextExpression<T> extends IExpression
This is an expression that will need access to the global variable everything.
Since:
2.0
  • Method Details

    • createContext

      IEvaluationContext createContext(Class<? extends T> elementClass, IIndexProvider<T> indexProvider)

      Creates a new context to be passed to a subsequent evaluation. The context will have the variable 'everything' set to an expression that represents the everything iterator filtered for instances of elementClass.

      The values of the iterator will be copied if necessary (when everything is referenced more then once).

      Parameters:
      elementClass - the class of the iterator elements
      indexProvider - The index provider that represents all queried material.
      Returns:
      A new evaluation context.
    • createContext

      IEvaluationContext createContext(Class<? extends T> elementClass, Iterator<T> everything)

      Creates a new context to be passed to a subsequent evaluation. The context will have the variable 'everything' set to an expression that represents the everything iterator filtered for instances of elementClass.

      The values of the iterator will be copied if necessary (when everything is referenced more then once).

      Parameters:
      elementClass - the class of the iterator elements
      everything - The iterator that represents all queried material.
      Returns:
      A new evaluation context.
    • getParameters

      Object[] getParameters()
      Returns the parameters that this context expression was created with.
      Returns:
      An array of parameters, possibly empty but never null.
    • iterator

      Iterator<T> iterator(IEvaluationContext context)
      Evaluate the expression and return the expected collection result as an iterator
      Parameters:
      context - The evaluation context
      Returns:
      The result of the evaluation.