@Override public long getDistance(VocabularyTerm fromTerm, VocabularyTerm toTerm) { if (fromTerm == null || toTerm == null) { return -1; } return fromTerm.getDistanceTo(toTerm); }
VocabularyTerm categoryTerm = getCategoryTerm(categoryId); long distance = (term != null) ? categoryTerm.getDistanceTo(term) : 1000 - categoryTerm.getDistanceTo(root); if (distance >= 0 && distance < bestDistance) { bestDistance = distance;
VocabularyTerm categoryTerm = getCategoryTerm(categoryId); long distance = (term != null) ? categoryTerm.getDistanceTo(term) : 1000 - categoryTerm.getDistanceTo(root); if (distance >= 0 && distance < bestDistance) { bestDistance = distance;