public static int getBoost(String fullyQualifiedTypeName, int min, int max) { float position= getDefault().getNormalizedPosition(fullyQualifiedTypeName); int dist= max - min; return Math.round(position * dist) + min; }
public static int getBoost(String fullyQualifiedTypeName, int min, int max) { float position= getDefault().getNormalizedPosition(fullyQualifiedTypeName); int dist= max - min; return Math.round(position * dist) + min; }
public static int getBoost(String fullyQualifiedTypeName, int min, int max) { float position= getDefault().getNormalizedPosition(fullyQualifiedTypeName); int dist= max - min; return Math.round(position * dist) + min; }
protected int computeRelevance() { /* * There are two histories: the RHS history remembers types used for the current expected * type (left hand side), while the type history remembers recently used types in general). * * The presence of an RHS ranking is a much more precise sign for relevance as it proves the * subtype relationship between the proposed type and the expected type. * * The "recently used" factor (of either the RHS or general history) is less important, it should * not override other relevance factors such as if the type is already imported etc. */ float rhsHistoryRank= fInvocationContext.getHistoryRelevance(getQualifiedTypeName()); float typeHistoryRank= QualifiedTypeNameHistory.getDefault().getNormalizedPosition(getQualifiedTypeName()); int recencyBoost= Math.round((rhsHistoryRank + typeHistoryRank) * 5); int rhsBoost= rhsHistoryRank > 0.0f ? 50 : 0; int baseRelevance= super.computeRelevance(); return baseRelevance + rhsBoost + recencyBoost; }
@Override protected int computeRelevance() { /* * There are two histories: the RHS history remembers types used for the current expected * type (left hand side), while the type history remembers recently used types in general). * * The presence of an RHS ranking is a much more precise sign for relevance as it proves the * subtype relationship between the proposed type and the expected type. * * The "recently used" factor (of either the RHS or general history) is less important, it should * not override other relevance factors such as if the type is already imported etc. */ float rhsHistoryRank= fInvocationContext.getHistoryRelevance(getQualifiedTypeName()); float typeHistoryRank= QualifiedTypeNameHistory.getDefault().getNormalizedPosition(getQualifiedTypeName()); int recencyBoost= Math.round((rhsHistoryRank + typeHistoryRank) * 5); int rhsBoost= rhsHistoryRank > 0.0f ? 50 : 0; int baseRelevance= super.computeRelevance(); return baseRelevance + rhsBoost + recencyBoost; }
@Override protected int computeRelevance() { /* * There are two histories: the RHS history remembers types used for the current expected * type (left hand side), while the type history remembers recently used types in general). * * The presence of an RHS ranking is a much more precise sign for relevance as it proves the * subtype relationship between the proposed type and the expected type. * * The "recently used" factor (of either the RHS or general history) is less important, it should * not override other relevance factors such as if the type is already imported etc. */ float rhsHistoryRank= fInvocationContext.getHistoryRelevance(getQualifiedTypeName()); float typeHistoryRank= QualifiedTypeNameHistory.getDefault().getNormalizedPosition(getQualifiedTypeName()); int recencyBoost= Math.round((rhsHistoryRank + typeHistoryRank) * 5); int rhsBoost= rhsHistoryRank > 0.0f ? 50 : 0; int baseRelevance= super.computeRelevance(); return baseRelevance + rhsBoost + recencyBoost; }