Class TypeInference
java.lang.Object
com.github.javaparser.symbolsolver.resolution.typeinference.TypeInference
The API exposed by the TypeInference subsystem.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanappearInThrowsClause(ResolvedTypeParameterDeclaration p, ResolvedMethodDeclaration methodDeclaration) private BoundSetboundSetup(List<ResolvedTypeParameterDeclaration> typeParameterDeclarations, List<InferenceVariable> inferenceVariables) When inference begins, a bound set is typically generated from a list of type parameter declarations P1, ..., Pp and associated inference variables α1, ..., αpprivate ConstraintFormulaSetconstraintSetFromArgumentsSubstitution(List<ResolvedType> Fs, List<Expression> es, Substitution theta, int k) private List<ResolvedType> formalParameterTypes(ResolvedMethodDeclaration methodDeclaration) voidfunctionalInterfaceParameterizationInference(LambdaExpr lambdaExpr, ResolvedInterfaceDeclaration interfaceDeclaration) instantiationInference(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) Public instance methodsinstantiationInference(List<Expression> argumentExpressions, ResolvedMethodDeclaration methodDeclaration) private static MethodUsageinstantiationSetToMethodUsage(ResolvedMethodDeclaration methodDeclaration, InstantiationSet instantiationSet) Private static methodsbooleaninvocationApplicabilityInference(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) Determine whether a potentially applicable generic method m is applicable for a method invocation that provides no explicit type arguments.voidprivate booleanisImplicitlyTyped(LambdaExpr lambdaExpr) private booleanisInexact(MethodReferenceExpr methodReferenceExpr) private booleanisPertinentToApplicability(Expression argument) booleanmoreSpecificMethodInference(MethodCallExpr methodCall, ResolvedMethodDeclaration m1, ResolvedMethodDeclaration m2) Return if m2 is more specific than m1private Optional<ConstraintFormulaSet> testForApplicabilityByLooseInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta) private Optional<ConstraintFormulaSet> testForApplicabilityByStrictInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta) private Optional<ConstraintFormulaSet> testForApplicabilityByVariableArityInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta) static MethodUsagetoMethodUsage(MethodCallExpr call, ResolvedMethodDeclaration methodDeclaration, TypeSolver typeSolver) Public static methodsprivate ResolvedTypetypeWithSubstitution(ResolvedType originalType, Substitution substitution)
-
Field Details
-
object
-
typeSolver
-
-
Constructor Details
-
TypeInference
-
-
Method Details
-
toMethodUsage
public static MethodUsage toMethodUsage(MethodCallExpr call, ResolvedMethodDeclaration methodDeclaration, TypeSolver typeSolver) Public static methods -
instantiationInference
public Optional<InstantiationSet> instantiationInference(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) Public instance methods -
instantiationInference
public Optional<InstantiationSet> instantiationInference(List<Expression> argumentExpressions, ResolvedMethodDeclaration methodDeclaration) -
invocationApplicabilityInference
public boolean invocationApplicabilityInference(MethodCallExpr methodCallExpr, ResolvedMethodDeclaration methodDeclaration) Determine whether a potentially applicable generic method m is applicable for a method invocation that provides no explicit type arguments. -
invocationTypeInferenceBoundsSetB3
-
invocationTypeInference
public void invocationTypeInference() -
functionalInterfaceParameterizationInference
public void functionalInterfaceParameterizationInference(LambdaExpr lambdaExpr, ResolvedInterfaceDeclaration interfaceDeclaration) -
moreSpecificMethodInference
public boolean moreSpecificMethodInference(MethodCallExpr methodCall, ResolvedMethodDeclaration m1, ResolvedMethodDeclaration m2) Return if m2 is more specific than m1- Parameters:
methodCall-m1-m2-
-
instantiationSetToMethodUsage
private static MethodUsage instantiationSetToMethodUsage(ResolvedMethodDeclaration methodDeclaration, InstantiationSet instantiationSet) Private static methods -
boundSetup
private BoundSet boundSetup(List<ResolvedTypeParameterDeclaration> typeParameterDeclarations, List<InferenceVariable> inferenceVariables) When inference begins, a bound set is typically generated from a list of type parameter declarations P1, ..., Pp and associated inference variables α1, ..., αp- Parameters:
typeParameterDeclarations-inferenceVariables-- Returns:
-
appearInThrowsClause
private boolean appearInThrowsClause(ResolvedTypeParameterDeclaration p, ResolvedMethodDeclaration methodDeclaration) -
formalParameterTypes
-
isImplicitlyTyped
-
isInexact
-
isPertinentToApplicability
-
testForApplicabilityByStrictInvocation
private Optional<ConstraintFormulaSet> testForApplicabilityByStrictInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta) -
typeWithSubstitution
-
testForApplicabilityByLooseInvocation
private Optional<ConstraintFormulaSet> testForApplicabilityByLooseInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta) -
constraintSetFromArgumentsSubstitution
private ConstraintFormulaSet constraintSetFromArgumentsSubstitution(List<ResolvedType> Fs, List<Expression> es, Substitution theta, int k) -
testForApplicabilityByVariableArityInvocation
private Optional<ConstraintFormulaSet> testForApplicabilityByVariableArityInvocation(List<ResolvedType> Fs, List<Expression> es, Substitution theta)
-