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 void remember(String fullyQualifiedTypeName) { getDefault().accessed(fullyQualifiedTypeName); }
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 void remember(String fullyQualifiedTypeName) { getDefault().accessed(fullyQualifiedTypeName); }
public static void remember(String fullyQualifiedTypeName) { getDefault().accessed(fullyQualifiedTypeName); }
public int compare(Object o1, Object o2) { if (((String)o1).equals(o2)) return 0; History history= QualifiedTypeNameHistory.getDefault(); int pos1= history.getPosition(o1); int pos2= history.getPosition(o2); if (pos1 == pos2) return Collator.getInstance().compare(o1, o2); if (pos1 > pos2) { return -1; } else { return 1; } }
@Override public int compare(String o1, String o2) { if (o1.equals(o2)) return 0; History<String, String> history= QualifiedTypeNameHistory.getDefault(); int pos1= history.getPosition(o1); int pos2= history.getPosition(o2); if (pos1 == pos2) return Collator.getInstance().compare(o1, o2); if (pos1 > pos2) { return -1; } else { return 1; } }
@Override public int compare(String o1, String o2) { if (o1.equals(o2)) return 0; History<String, String> history= QualifiedTypeNameHistory.getDefault(); int pos1= history.getPosition(o1); int pos2= history.getPosition(o2); if (pos1 == pos2) return Collator.getInstance().compare(o1, o2); if (pos1 > pos2) { return -1; } else { return 1; } }
@Override public int compare(String o1, String o2) { if (o1.equals(o2)) return 0; History<String, String> history= QualifiedTypeNameHistory.getDefault(); int pos1= history.getPosition(o1); int pos2= history.getPosition(o2); if (pos1 == pos2) return Collator.getInstance().compare(o1, o2); if (pos1 > pos2) { return -1; } else { return 1; } }
@Override public int compare(String o1, String o2) { if (o1.equals(o2)) return 0; History<String, String> history= QualifiedTypeNameHistory.getDefault(); int pos1= history.getPosition(o1); int pos2= history.getPosition(o2); if (pos1 == pos2) return Collator.getInstance().compare(o1, o2); if (pos1 > pos2) { return -1; } else { return 1; } }
public int compare(Object o1, Object o2) { if (((String)o1).equals(o2)) return 0; History history= QualifiedTypeNameHistory.getDefault(); int pos1= history.getPosition(o1); int pos2= history.getPosition(o2); if (pos1 == pos2) return Collator.getInstance().compare(o1, o2); if (pos1 > pos2) { return -1; } else { return 1; } }
public int compare(Object o1, Object o2) { if (((String)o1).equals(o2)) return 0; History history= QualifiedTypeNameHistory.getDefault(); int pos1= history.getPosition(o1); int pos2= history.getPosition(o2); if (pos1 == pos2) return Collator.getInstance().compare(o1, o2); if (pos1 > pos2) { return -1; } else { return 1; } }
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; }
QualifiedTypeNameHistory.getDefault().save();
QualifiedTypeNameHistory.getDefault().save();
QualifiedTypeNameHistory.getDefault().save();