Package gw.lang.reflect
Class MethodScorer
- java.lang.Object
-
- gw.lang.reflect.MethodScorer
-
public class MethodScorer extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classMethodScorer.MethodScoreCachestatic classMethodScorer.MethodScoreKey
-
Field Summary
Fields Modifier and Type Field Description private MethodScorer.MethodScoreCache_methodScoreCacheprivate TypeSystemAwareCache<Pair<IType,IType>,java.lang.Double>_typeScoreCachestatic intBOXED_COERCION_SCOREprivate static MethodScorerINSTANCEstatic intPRIMITIVE_COERCION_SCORE
-
Constructor Summary
Constructors Modifier Constructor Description privateMethodScorer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double_addToScoreForTypes(java.util.List<IType> inferringTypes, IType paramType, IType argType)doubleaddDegreesOfSeparation(IType parameterType, IType exprType, java.util.List<IType> inferringTypes)doubleaddDegreesOfSeparation(IType parameterType, java.util.Set<? extends IType> types, java.util.List<IType> inferringTypes)private doubleaddDegreesOfSeparationFromParameterization(IType parameterType, IType exprType, java.util.List<IType> inferringTypes)doubleaddToScoreForTypes(java.util.List<IType> inferringTypes, IType paramType, IType argType)private booleanarePrimitiveTypesCompatible(IType paramType, IType argType)IInvocableTypegetCachedMethodScore(IInvocableType funcType, IType callsiteEnclosingType, IType rootType, java.util.List<IType> argTypes)<E extends IType>
EgetGenericType(E type)static MethodScorerinstance()private IInvocableTypematchInOverloads(java.util.List<? extends IInvocableType> listOverloads, IInvocableType cachedFuncType)MethodScorer.MethodScoreKeyputCachedMethodScore(MethodScore score)voidremoveCachedMethodScore(MethodScorer.MethodScoreKey key)doublescoreMethod(IInvocableType funcType, java.util.List<IType> argTypes, java.util.List<IType> inferringTypes)MethodScorescoreMethod(IType callsiteEnclosingType, IType rootType, IInvocableType funcType, java.util.List<? extends IInvocableType> listFunctionTypes, java.util.List<IType> argTypes, java.util.List<IType> inferringTypes, boolean bSkipScoring, boolean bLookInCache)java.util.List<MethodScore>scoreMethods(java.util.List<IInvocableType> funcTypes, java.util.List<IType> argTypes)
-
-
-
Field Detail
-
BOXED_COERCION_SCORE
public static final int BOXED_COERCION_SCORE
- See Also:
- Constant Field Values
-
PRIMITIVE_COERCION_SCORE
public static final int PRIMITIVE_COERCION_SCORE
- See Also:
- Constant Field Values
-
INSTANCE
private static volatile MethodScorer INSTANCE
-
_typeScoreCache
private final TypeSystemAwareCache<Pair<IType,IType>,java.lang.Double> _typeScoreCache
-
_methodScoreCache
private final MethodScorer.MethodScoreCache _methodScoreCache
-
-
Method Detail
-
instance
public static MethodScorer instance()
-
scoreMethods
public java.util.List<MethodScore> scoreMethods(java.util.List<IInvocableType> funcTypes, java.util.List<IType> argTypes)
-
scoreMethod
public MethodScore scoreMethod(IType callsiteEnclosingType, IType rootType, IInvocableType funcType, java.util.List<? extends IInvocableType> listFunctionTypes, java.util.List<IType> argTypes, java.util.List<IType> inferringTypes, boolean bSkipScoring, boolean bLookInCache)
-
matchInOverloads
private IInvocableType matchInOverloads(java.util.List<? extends IInvocableType> listOverloads, IInvocableType cachedFuncType)
-
scoreMethod
public double scoreMethod(IInvocableType funcType, java.util.List<IType> argTypes, java.util.List<IType> inferringTypes)
-
addToScoreForTypes
public double addToScoreForTypes(java.util.List<IType> inferringTypes, IType paramType, IType argType)
-
_addToScoreForTypes
public double _addToScoreForTypes(java.util.List<IType> inferringTypes, IType paramType, IType argType)
-
arePrimitiveTypesCompatible
private boolean arePrimitiveTypesCompatible(IType paramType, IType argType)
-
addDegreesOfSeparation
public double addDegreesOfSeparation(IType parameterType, IType exprType, java.util.List<IType> inferringTypes)
-
addDegreesOfSeparationFromParameterization
private double addDegreesOfSeparationFromParameterization(IType parameterType, IType exprType, java.util.List<IType> inferringTypes)
-
addDegreesOfSeparation
public double addDegreesOfSeparation(IType parameterType, java.util.Set<? extends IType> types, java.util.List<IType> inferringTypes)
-
getGenericType
public <E extends IType> E getGenericType(E type)
-
getCachedMethodScore
public IInvocableType getCachedMethodScore(IInvocableType funcType, IType callsiteEnclosingType, IType rootType, java.util.List<IType> argTypes)
-
putCachedMethodScore
public MethodScorer.MethodScoreKey putCachedMethodScore(MethodScore score)
-
removeCachedMethodScore
public void removeCachedMethodScore(MethodScorer.MethodScoreKey key)
-
-