Package gw.lang.reflect
Class MethodScorer
java.lang.Object
gw.lang.reflect.MethodScorer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MethodScorer.MethodScoreCache
private final TypeSystemAwareCache<Pair<IType,
IType>, Double> static final int
private static MethodScorer
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
_addToScoreForTypes
(List<IType> inferringTypes, IType paramType, IType argType) double
addDegreesOfSeparation
(IType parameterType, IType exprType, List<IType> inferringTypes) double
private double
addDegreesOfSeparationFromParameterization
(IType parameterType, IType exprType, List<IType> inferringTypes) double
addToScoreForTypes
(List<IType> inferringTypes, IType paramType, IType argType) private boolean
arePrimitiveTypesCompatible
(IType paramType, IType argType) getCachedMethodScore
(IInvocableType funcType, IType callsiteEnclosingType, IType rootType, List<IType> argTypes) <E extends IType>
EgetGenericType
(E type) static MethodScorer
instance()
private IInvocableType
matchInOverloads
(List<? extends IInvocableType> listOverloads, IInvocableType cachedFuncType) putCachedMethodScore
(MethodScore score) void
double
scoreMethod
(IInvocableType funcType, List<IType> argTypes, List<IType> inferringTypes) scoreMethod
(IType callsiteEnclosingType, IType rootType, IInvocableType funcType, List<? extends IInvocableType> listFunctionTypes, List<IType> argTypes, List<IType> inferringTypes, boolean bSkipScoring, boolean bLookInCache) scoreMethods
(List<IInvocableType> funcTypes, List<IType> argTypes)
-
Field Details
-
BOXED_COERCION_SCORE
public static final int BOXED_COERCION_SCORE- See Also:
-
PRIMITIVE_COERCION_SCORE
public static final int PRIMITIVE_COERCION_SCORE- See Also:
-
INSTANCE
-
_typeScoreCache
-
_methodScoreCache
-
-
Constructor Details
-
MethodScorer
private MethodScorer()
-
-
Method Details
-
instance
-
scoreMethods
-
scoreMethod
public MethodScore scoreMethod(IType callsiteEnclosingType, IType rootType, IInvocableType funcType, List<? extends IInvocableType> listFunctionTypes, List<IType> argTypes, List<IType> inferringTypes, boolean bSkipScoring, boolean bLookInCache) -
matchInOverloads
private IInvocableType matchInOverloads(List<? extends IInvocableType> listOverloads, IInvocableType cachedFuncType) -
scoreMethod
public double scoreMethod(IInvocableType funcType, List<IType> argTypes, List<IType> inferringTypes) -
addToScoreForTypes
-
_addToScoreForTypes
-
arePrimitiveTypesCompatible
-
addDegreesOfSeparation
-
addDegreesOfSeparationFromParameterization
-
addDegreesOfSeparation
-
getGenericType
-
getCachedMethodScore
public IInvocableType getCachedMethodScore(IInvocableType funcType, IType callsiteEnclosingType, IType rootType, List<IType> argTypes) -
putCachedMethodScore
-
removeCachedMethodScore
-