org.aspectj.org.eclipse.jdt.internal.compiler.lookup
Class InferenceSubstitution

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope.Substitutor
      extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.InferenceSubstitution
All Implemented Interfaces:
Substitution

public class InferenceSubstitution
extends Scope.Substitutor
implements Substitution

A type variable substitution strategy based on inference variables (JLS8 18.1.1)


Constructor Summary
InferenceSubstitution(LookupEnvironment environment, InferenceVariable[] variables)
           
 
Method Summary
 LookupEnvironment environment()
          Returns the lookup environment
protected  TypeBinding getP(int i)
          Get the type corresponding to the ith inference variable.
 boolean isRawSubstitution()
          Returns true for raw substitution
 TypeBinding substitute(Substitution substitution, TypeBinding originalType)
          Override method Scope.Substitutor.substitute(Substitution, TypeBinding), to add substitution of types other than type variables.
 TypeBinding substitute(TypeVariableBinding typeVariable)
          Returns the type substitute for a given type variable, or itself if no substitution got performed.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Scope.Substitutor
substitute, substitute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InferenceSubstitution

public InferenceSubstitution(LookupEnvironment environment,
                             InferenceVariable[] variables)
Method Detail

substitute

public TypeBinding substitute(Substitution substitution,
                              TypeBinding originalType)
Override method Scope.Substitutor.substitute(Substitution, TypeBinding), to add substitution of types other than type variables.

Overrides:
substitute in class Scope.Substitutor

getP

protected TypeBinding getP(int i)
Get the type corresponding to the ith inference variable. Default behavior is to answer the inference variable's type parameter. Sub-class may override to substitute other types.


substitute

public TypeBinding substitute(TypeVariableBinding typeVariable)
Description copied from interface: Substitution
Returns the type substitute for a given type variable, or itself if no substitution got performed.

Specified by:
substitute in interface Substitution

environment

public LookupEnvironment environment()
Description copied from interface: Substitution
Returns the lookup environment

Specified by:
environment in interface Substitution

isRawSubstitution

public boolean isRawSubstitution()
Description copied from interface: Substitution
Returns true for raw substitution

Specified by:
isRawSubstitution in interface Substitution