Class ResolvingContextImpl

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <R,​E extends Expression<R>>
      void
      put​(E key, R value)
      Put a key and value in the resolving context.
      void putAllNew​(ResolvingContext context)
      Put all new key/value pairs in the resolving context from a previous version of it
      <R,​E extends Expression<R>>
      R
      resolvedValueOf​(E expression)
      Retrieves the resolved value for the expression.
      <E extends Expression<?>>
      boolean
      resolves​(E expression)
      Checks if the expression is resolved within this context.
      int size()
      Retrieves the amount of resolved values which are stored in the context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResolvingContextImpl

        public ResolvingContextImpl()
    • Method Detail

      • size

        public int size()
        Description copied from interface: ResolvingContext
        Retrieves the amount of resolved values which are stored in the context.
        Specified by:
        size in interface ResolvingContext
        Returns:
        the number of stored resolved values
      • resolves

        public <E extends Expression<?>> boolean resolves​(E expression)
        Description copied from interface: ResolvingContext
        Checks if the expression is resolved within this context. Only if this method returns true, then it is safe to call the ResolvingContext.resolvedValueOf(Expression) method. An expression is seen as resolved, either if the context knows already the resolved value or, if the given expression is a resolved expression by itself.
        Specified by:
        resolves in interface ResolvingContext
        Parameters:
        expression - the expression for which to check if it is resolved
        Returns:
        true if the expression is resolved within the context, false if not
      • resolvedValueOf

        public <R,​E extends Expression<R>> R resolvedValueOf​(E expression)
        Description copied from interface: ResolvingContext
        Retrieves the resolved value for the expression. This action can be completed, if the result of the given expression is already known within the context, or if the expression is a resolved expression itself.

        An IllegalArgumentException will be thrown, if the expression cannot be resolved within the context. Therefore it is mandatory to call the ResolvingContext.resolves(Expression) method first to check if the expression is resolved in the context.

        Specified by:
        resolvedValueOf in interface ResolvingContext
        Parameters:
        expression - the expression for which to retrieve the resolved value
        Returns:
        the resolved value for the expression
      • put

        public <R,​E extends Expression<R>> void put​(E key,
                                                          R value)
        Description copied from interface: EditableResolvingContext
        Put a key and value in the resolving context. The key is usually an unresolved node and the value is the resolved version of this node
        Specified by:
        put in interface EditableResolvingContext
        Parameters:
        key - the unresolved node
        value - the resolved version of the key node