getMatchingAttributionsWithin method
Set<Attribution>
getMatchingAttributionsWithin({
- required Set<
Attribution> attributions, - required int start,
- required int end,
Finds and returns all Attributions in this AttributedSpans that
match any of the given attributions
.
Two Attributions are said to "match" if their id
s are equal.
Implementation
Set<Attribution> getMatchingAttributionsWithin({
required Set<Attribution> attributions,
required int start,
required int end,
}) {
final matchingAttributions = <Attribution>{};
for (int i = start; i <= end; ++i) {
for (final attribution in attributions) {
final otherAttributions = getAllAttributionsAt(i);
for (final otherAttribution in otherAttributions) {
if (otherAttribution.id == attribution.id) {
matchingAttributions.add(otherAttribution);
}
}
}
}
return matchingAttributions;
}