}
}
private ColumnAffinity findAffinity(ColumnTemplateTerm currentTerm,
ColumnTemplateTerm comparisonTerm, Map<ColumnTemplateTerm, HNodePath> termToPath) {
ColumnAffinity closestAffinity = NoColumnAffinity.INSTANCE;
for(ColumnAffinity affinity : affinities)
{
HNodePath currentPath = termToPath.get(currentTerm);
HNodePath comparisonPath= termToPath.get(comparisonTerm);
if(affinity.isValidFor(currentPath, comparisonPath))
{
ColumnAffinity generatedAffinity = affinity.generateAffinity(currentPath, comparisonPath);
if(generatedAffinity.isCloserThan(closestAffinity))
{
closestAffinity = generatedAffinity;
}
}
}