Sync Iterator
An iterator over a collection. Allows to sequentially access the elements. Must be closed at the end to cleanup resources.
Instances of this interface are not thread-safe and shall not be used from concurrent coroutines.
See also
Example 1:
val iterator = map.iterator()
try {
while (iterator.hasNext()) {
println(iterator.next())
}
} finally {
iterator.close()
}
Content copied to clipboard
Example 2:
map.queryItems().forEach { item ->
put(item.key, item.data())
}
Content copied to clipboard
Example 3:
val allItems = map.queryItems().asFlow().toList()
Content copied to clipboard