Collections

An immutable `Map` with no entries.

- `Anything`
  - `Object`
    - `emptyMap` ...and other supertypes

- `emptyMap`
  - `Map`
    - `Collection`
      - `Iterable`
        - `Category`
    - `Correspondence`
  - `Object`
    - `Anything`

no subtypes hierarchy

Attributes
`empty` | Source Code `shared actual Boolean empty` Determines if the stream is empty, that is to say, if the iterator returns no elements. Refines `Collection.empty` ultimately refines `Iterable.empty`
`items` | Source Code `shared actual Collection<Nothing> items` A `Collection` containing the items stored in this map. An element can be stored under more than one key in the map, and so it can occur more than once in the resulting collection. Refines `Map.items`
`keys` | Source Code `shared actual Collection<Nothing> keys` The `Category` of all keys for which a value is defined by this `Correspondence`. Refines `Map.keys` ultimately refines `Correspondence.keys`
`size` | Source Code `shared actual Integer size` The number of elements returned by the `Iterable.iterator()` of this stream, if the iterator terminates. In the case of an infinite stream, this operation never terminates. Refines `Iterable.size`

Inherited Attributes
Attributes inherited from: `Object` `hash`, `string`
Attributes inherited from: `Collection<Element>` `empty`, `permutations`, `string`
Attributes inherited from: `Correspondence<Key,Item>` `keys`
Attributes inherited from: `Iterable<Element,Absent>` `coalesced`, `cycled`, `distinct`, `empty`, `exceptLast`, `first`, `indexed`, `last`, `paired`, `rest`, `size`, `string`
Attributes inherited from: `Map<Key,Item>` `coalescedMap`, `distinct`, `hash`, `items`, `keys`

Methods
`any` | Source Code `shared actual Boolean any(Boolean selecting(Nothing->Nothing element))` Determines if there is at least one element of this stream that satisfies the given predicate function. If the stream is empty, returns `false`. For an infinite stream, this operation might not terminate. Refines `Iterable.any`
`by` | Source Code `shared actual {<Nothing->Nothing>*} by(Integer step)` Produces a stream containing every `step`th element of this stream. If the step size is `1`, the resulting stream contains the same elements as this stream. For example, the expression
    (0..10).by(3)
results in the stream `{ 0, 3, 6, 9 }`. The step size must be greater than zero. Refines `Iterable.by`
`clone` | Source Code `shared actual Map<Nothing,Nothing> clone()` A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned. Refines `Map.clone` ultimately refines `Collection.clone`
`contains` | Source Code `shared actual Boolean contains(Object element)` Returns `true` if the given value belongs to this `Category`, that is, if it is an element of this `Category`, or `false` otherwise. For most `Category`s the following relationship is satisfied by every pair of elements `x` and `y`: if `x==y`, then `x in category == y in category` However, it is possible to form a useful `Category` consistent with some other equivalence relation, for example `===`. Therefore implementations of `contains()` which do not satisfy this relationship are tolerated. Refines `Map.contains` ultimately refines `Category.contains`
`containsAny` | Source Code `shared actual Boolean containsAny({Object*} elements)` Returns `true` if any one of the given values belongs to this `Category`, or `false` otherwise. Refines `Category.containsAny`
`containsEvery` | Source Code `shared actual Boolean containsEvery({Object*} elements)` Returns `true` if every one of the given values belongs to this `Category`, or `false` otherwise. Refines `Category.containsEvery`
`count` | Source Code `shared actual Integer count(Boolean selecting(Nothing->Nothing element))` Produces the number of elements in this stream that satisfy the given predicate function. For an infinite stream, this method never terminates. Refines `Iterable.count`
`defines` | Source Code `shared actual Boolean defines(Object index)` Determines if there is a value defined for the given key. Refines `Map.defines` ultimately refines `Correspondence.defines`
`each` | Source Code `shared actual void each(void step(Nothing->Nothing element))` Call the given function for each element of this stream, passing the elements in the order they occur in this stream. For example:
    words.each((word) {
        print(word.lowercased);
        print(word.uppercased);
    });
Has the same effect as the following `for` loop:
    for (word in words) {
        print(word.lowercased);
        print(word.uppercased);
    }
For certain streams this method is highly efficient, surpassing the performance of `for` loops on the JVM. Thus, `each()` is sometimes preferred in highly performance-critical low-level code. Refines `Iterable.each`
`every` | Source Code `shared actual Boolean every(Boolean selecting(Nothing->Nothing element))` Determines if all elements of this stream satisfy the given predicate function. If the stream is empty, return `true`. For an infinite stream, this operation might not terminate. Refines `Iterable.every`
`find` | Source Code `shared actual Null find(Boolean selecting(Nothing->Nothing element))` The first element of this stream which satisfies the given predicate function, if any, or `null` if there is no such element. For an infinite stream, this method might not terminate. For example, the expression
    (-10..10).find(Integer.positive)
evaluates to `1`. Refines `Iterable.find`
`findLast` | Source Code `shared actual Null findLast(Boolean selecting(Nothing->Nothing element))` The last element of this stream which satisfies the given predicate function, if any, or `null` if there is no such element. For an infinite stream, this method will not terminate. For example, the expression
    (-10..10).findLast(3.divides)
evaluates to `9`. Refines `Iterable.findLast`
`get` | Source Code `shared actual Null get(Object key)` Returns the value defined for the given key, or `null` if there is no value defined for the given key. Refines `Map.get` ultimately refines `Correspondence.get`
`getOrDefault` | Source Code `shared actual Default getOrDefault<Default>(Object key, Default default)` Returns the item of the entry with the given `key`, or the given `default` if there is no entry with the given `key` in this map. For maps with non-null items, the expression:
    map.getOrDefault(key, def)
is equivalent to this common idiom:
    map[key] else def
However, when the map has null items, `getOrDefault()` will preserve them. Note that high-quality implementations of `Map` should refine this default implementation. Refines `Map.getOrDefault`
`iterator` | Source Code `shared actual Iterator<Nothing->Nothing> iterator()` An iterator for the elements belonging to this stream. Refines `Iterable.iterator`
`mapItems` | Source Code `shared actual Map<Nothing,Nothing> mapItems<Result>(Result mapping(Nothing key, Nothing item)) given Result satisfies Object` Produces a map with the same `Map.keys` as this map. For every key, the item is the result of applying the given transformation function to its associated item in this map. This is a lazy operation, returning a view of this map. Refines `Map.mapItems`
`skip` | Source Code `shared actual {<Nothing->Nothing>*} skip(Integer skipping)` Produces a stream containing the elements of this stream, after skipping the first `skipping` elements produced by its iterator. If this stream does not contain more elements than the specified number of elements to skip, the resulting stream has no elements. If the specified number of elements to skip is zero or fewer, the resulting stream contains the same elements as this stream. Refines `Iterable.skip`
`take` | Source Code `shared actual {<Nothing->Nothing>*} take(Integer taking)` Produces a stream containing the first `taking` elements of this stream. If the specified number of elements to take is larger than the number of elements of this stream, the resulting stream contains the same elements as this stream. If the specified number of elements to take is fewer than one, the resulting stream has no elements. Refines `Iterable.take`

Inherited Methods
Methods inherited from: `Object` `equals()`
Methods inherited from: `Category<Element>` `contains()`, `containsAny()`, `containsEvery()`
Methods inherited from: `Collection<Element>` `clone()`, `contains()`
Methods inherited from: `Correspondence<Key,Item>` `defines()`, `definesAny()`, `definesEvery()`, `get()`, `getAll()`
Methods inherited from: `Iterable<Element,Absent>` `any()`, `by()`, `chain()`, `collect()`, `contains()`, `count()`, `defaultNullElements()`, `each()`, `every()`, `filter()`, `find()`, `findLast()`, `flatMap()`, `fold()`, `follow()`, `frequencies()`, `getFromFirst()`, `group()`, `indexes()`, `interpose()`, `iterator()`, `locate()`, `locateLast()`, `locations()`, `longerThan()`, `map()`, `max()`, `narrow()`, `partition()`, `product()`, `reduce()`, `repeat()`, `scan()`, `select()`, `sequence()`, `shorterThan()`, `skip()`, `skipWhile()`, `sort()`, `spread()`, `summarize()`, `tabulate()`, `take()`, `takeWhile()`
Methods inherited from: `Map<Key,Item>` `clone()`, `contains()`, `defaultNullElements()`, `defaultNullItems()`, `defines()`, `equals()`, `filterKeys()`, `get()`, `getOrDefault()`, `inverse()`, `mapItems()`, `patch()`