Class ExpressionEvaluator

java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.expression.tree.ExpressionEvaluator

public final class ExpressionEvaluator extends Object
Turns expression trees into variables.
  • Method Details

    • buildLazy

      @Nullable public static IVariable<?> buildLazy(ExpressionNode root, int rootId, ILazyExpressionValueCache rootCache, IntFunction<IVariable<?>> refs)
      Build a variable tree of cached lazy expressions. The root operator node is cached in the given value cache under the given id, inner operator nodes are cached in a cache that is local to this tree.
      Parameters:
      root - The root node.
      rootId - The id under which the root is cached.
      rootCache - The value cache of the root, usually the network.
      refs - Resolves referenced variables, may return null if not available.
      Returns:
      The root variable, or null if a reference could not be resolved.
    • buildBound

      public static IVariable<?> buildBound(ExpressionNode node, IVariable[] params, it.unimi.dsi.fastutil.ints.Int2ObjectMap<IVariable<?>> refs) throws EvaluationException
      Build a variable for a single evaluation. Operator nodes are evaluated lazily and at most once.
      Parameters:
      node - The node.
      params - The parameter values.
      refs - Bound referenced variables.
      Returns:
      The variable.
      Throws:
      EvaluationException - If a node can not be bound.