Files
kotlin-fork/libraries/stdlib/src/kotlin
2015-07-07 16:35:22 +03:00
..
2015-07-07 16:35:22 +03:00
2015-05-27 22:16:19 +03:00

Collections API

There are a number of extension functions on Collection, Iterator, Map and arrays to allow easy composition collections using familiar combinators like

Functions on Collection, Map and arrays are all eager, in that methods like map() will create a complete result List when the method completes.

Functions on Iterator are lazy so that they try to return new iterators that lazily evaluate things. For example map() returns a new Iterator that lazily maps the values in the original iterator.

Preconditions

When writing code it is recommended you add checks early in a function to ensure parameters are valid. There are a number of helper methods for this: