Enum UnresolvedCall.ResolutionStrategy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UnresolvedCall.ResolutionStrategy>
    Enclosing class:
    UnresolvedCall

    public static enum UnresolvedCall.ResolutionStrategy
    extends java.lang.Enum<UnresolvedCall.ResolutionStrategy>
    An enum defining the different types of resolution strategies for call signatures. Depending on the language, targets of calls might be resolved (at compile time or runtime) relying on the static or runtime type of their parameters. Each strategy in this enum comes with a different matches(Parameter[], Expression[]) implementation that can automatically detect if the signature of a cfg is matched by the given expressions representing the parameters for a call to that cfg.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DYNAMIC_TYPES
      A strategy where the dynamic (runtime) types of the parameters of the call are evaluated against the signature of a cfg: for each parameter, if at least one of the runtime types of the actual parameter can be assigned to the type of the formal parameter, than matches(Parameter[], Expression[]) return true.
      FIRST_DYNAMIC_THEN_STATIC
      A strategy where the first parameter is tested using DYNAMIC_TYPES, while the rest is tested using STATIC_TYPES.
      STATIC_TYPES
      A strategy where the static types of the parameters of the call are evaluated against the signature of a cfg: for each parameter, if the static type of the actual parameter can be assigned to the type of the formal parameter, than matches(Parameter[], Expression[]) return true.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract boolean matches​(int pos, Parameter formal, Expression actual)
      Yields true if and only if the signature of the pos-th parameter of a cfg is matched by the given actual parameter, according to this strategy.
      boolean matches​(Parameter[] formals, Expression[] actuals)
      Yields true if and only if the signature of a cfg (i.e.
      static UnresolvedCall.ResolutionStrategy valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static UnresolvedCall.ResolutionStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • STATIC_TYPES

        public static final UnresolvedCall.ResolutionStrategy STATIC_TYPES
        A strategy where the static types of the parameters of the call are evaluated against the signature of a cfg: for each parameter, if the static type of the actual parameter can be assigned to the type of the formal parameter, than matches(Parameter[], Expression[]) return true.
      • DYNAMIC_TYPES

        public static final UnresolvedCall.ResolutionStrategy DYNAMIC_TYPES
        A strategy where the dynamic (runtime) types of the parameters of the call are evaluated against the signature of a cfg: for each parameter, if at least one of the runtime types of the actual parameter can be assigned to the type of the formal parameter, than matches(Parameter[], Expression[]) return true.
    • Method Detail

      • values

        public static UnresolvedCall.ResolutionStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (UnresolvedCall.ResolutionStrategy c : UnresolvedCall.ResolutionStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static UnresolvedCall.ResolutionStrategy valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • matches

        public final boolean matches​(Parameter[] formals,
                                     Expression[] actuals)
        Yields true if and only if the signature of a cfg (i.e. the types of its parameters) is matched by the given actual parameters, according to this strategy.
        Parameters:
        formals - the parameters definition of the cfg
        actuals - the expression that are used as call parameters
        Returns:
        true if and only if that condition holds
      • matches

        protected abstract boolean matches​(int pos,
                                           Parameter formal,
                                           Expression actual)
        Yields true if and only if the signature of the pos-th parameter of a cfg is matched by the given actual parameter, according to this strategy.
        Parameters:
        pos - the position of the parameter being evaluated
        formal - the parameter definition of the cfg
        actual - the expression that is used as parameter
        Returns:
        true if and only if that condition holds