forEachKeyPrefixedBy method
void
forEachKeyPrefixedBy(})
Applies f
to each key/value pair of the TTMultiMap
where key is prefixed by prefix
.
Calling f
must not add or remove keys from the TTMultiMap
See keysByPrefix for more information on result ordering,
near neighbour search (maxPrefixEditDistance
) etc.
Throws ArgumentError if prefix
is empty or null.
Implementation
@override
void forEachKeyPrefixedBy(
String prefix, void Function(String key, List<V> values) f,
{int maxPrefixEditDistance = 0}) {
ArgumentError.checkNotNull(f, 'f');
final itr =
keysByPrefix(prefix, maxPrefixEditDistance: maxPrefixEditDistance)
.iterator as InOrderKeyIterator<V>;
while (itr.moveNext()) {
f(itr.currentKey, itr.currentValue as List<V>);
}
}