for (ListIterator<SimilarityGroup> it = _similarityGroups.listIterator(); it.hasNext();) {
SimilarityGroup similarityGroup = it.next();
if (matches(value, similarityGroup)) {
RowAnnotation annotation = similarityGroup.getAnnotation();
it.set(new SimilarityGroup(annotation, _rowAnnotationFactory, _column, value, similarityGroup
.getValues()));
_rowAnnotationFactory.annotate(row, distinctCount, annotation);
foundMatch = true;
}
}
if (!foundMatch) {
RowAnnotation annotation = _rowAnnotationFactory.createAnnotation();
_rowAnnotationFactory.annotate(row, distinctCount, annotation);
_similarityGroups.add(new SimilarityGroup(annotation, _rowAnnotationFactory, _column, value,
new String[0]));
}
}