Home » openjdk-7 » com.sun.tools » javac » comp » [javadoc | source]
com.sun.tools.javac.comp
public class: Infer [javadoc | source]
java.lang.Object
   com.sun.tools.javac.comp.Infer
Helper class for type parameter inference, used by the attribution phase.

This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Nested Class Summary:
public static class  Infer.InferenceException   
public static class  Infer.NoInstanceException   
public static class  Infer.InvalidInstanceException   
abstract static class  Infer.UninferredMethodType  A delegated type representing a partially uninferred method type. The return type of a partially uninferred method type is a ForAll type - when the return type is instantiated (see Infer.instantiateExpr) the underlying method type is also updated. 
Field Summary
protected static final  Key<Infer> inferKey     
public static final  Type anyPoly    A value for prototypes that admit any type, including polymorphic ones. 
 Symtab syms     
 Types types     
 Check chk     
 Resolve rs     
 Factory diags     
 Mapping fromTypeVarFun    A mapping that turns type variables into undetermined type variables. 
 Mapping getInstFun    A mapping that returns its type argument with every UndetVar replaced by its `inst' field. Throws a NoInstanceException if this not possible because an `inst' field is null. Note: mutually referring undertvars will be left uninstantiated (that is, they will be replaced by the underlying type-variable). 
 Mapping implicitArgType     
Constructor:
 protected Infer(Context context) 
Method from com.sun.tools.javac.comp.Infer Summary:
checkWithinBounds,   instance,   instantiateExpr,   instantiateMethod,   instantiatePolymorphicSignatureInstance,   maximizeInst,   minimizeInst
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.sun.tools.javac.comp.Infer Detail:
  void checkWithinBounds(List<Type> tvars,
    List<Type> arguments,
    Warner warn) throws InvalidInstanceException 
    check that type parameters are within their bounds.
 public static Infer instance(Context context) 
 public Type instantiateExpr(ForAll that,
    Type to,
    Warner warn) throws InferenceException 
    Try to instantiate expression type `that' to given type `to'. If a maximal instantiation exists which makes this type a subtype of type `to', return the instantiated type. If no instantiation exists, or if several incomparable best instantiations exist throw a NoInstanceException.
 public Type instantiateMethod(Env<AttrContext> env,
    List<Type> tvars,
    MethodType mt,
    Symbol msym,
    List<Type> argtypes,
    boolean allowBoxing,
    boolean useVarargs,
    Warner warn) throws InferenceException 
    Instantiate method type `mt' by finding instantiations of `tvars' so that method can be applied to `argtypes'.
 Type instantiatePolymorphicSignatureInstance(Env<AttrContext> env,
    Type site,
    Name name,
    MethodSymbol spMethod,
    List<Type> argtypes) 
    Compute a synthetic method type corresponding to the requested polymorphic method signature. The target return type is computed from the immediately enclosing scope surrounding the polymorphic-signature call.
  void maximizeInst(UndetVar that,
    Warner warn) throws NoInstanceException 
    Instantiate undetermined type variable to its minimal upper bound. Throw a NoInstanceException if this not possible.
  void minimizeInst(UndetVar that,
    Warner warn) throws NoInstanceException 
    Instantiate undetermined type variable to the lub of all its lower bounds. Throw a NoInstanceException if this not possible.