description

# dart:collection library

Classes and utilities that supplement the collection support in dart:core.

To use this library in your code:

    import 'dart:collection';

## Map

A finite mapping from unique keys to their associated values. Allows efficient lookup of the value associated with a key, if any, and iterating through the individual keys and values of the map. The Map interface has a number of implementations, including the following:

- HashMap is unordered, the order of iteration is not guaranteed.
- LinkedHashMap iterates in key insertion order.
- SplayTreeMap iterates the keys in sorted order.
- UnmodifiableMapView is a wrapper, an unmodifiable Map view of another `Map`.

## Set

A collection of objects in which each object can occur only once. The Set interface has a number of implementations, including the following:

- HashSet does not guarantee the order of the objects in the iterations.
- LinkedHashSet iterates the objects in insertion order.
- SplayTreeSet iterates the objects in sorted order.
- UnmodifiableSetView is a wrapper, an unmodifiable Set view of another `Set`.

## Queue

A queue is a sequence of elements that is intended to be modified, by adding or removing elements, only at its ends. Dart queues are double ended queues, which means that they can be accessed equally from either end, and can therefore be used to implement both stack and queue behavior.

- Queue is the general interface for queues.
- ListQueue is a list-based queue. Default implementation for Queue.
- DoubleLinkedQueue is a queue implementation based on a double-linked list.

## List

An indexable sequence of objects. Objects can be accessed using their position, index, in the sequence. List is also called an "array" in other programming languages.

- UnmodifiableListView is a wrapper, an unmodifiable List view of another `List`.

## LinkedList

LinkedList is a specialized double-linked list of elements that extends LinkedListEntry. Each element knows its own place in the linked list, as well as which list it is in.

## Classes

DoubleLinkedQueue<E>
  A Queue implementation based on a double-linked list.
DoubleLinkedQueueEntry<E>
  An entry in a doubly linked list.
HashMap<K, V>
  A hash-table based implementation of Map.
HashSet<E>
  An unordered hash-table based Set implementation.
HasNextIterator<E>
  Wrapper for Iterator providing the pre-Dart 1.0 iterator interface.
LinkedHashMap<K, V>
  An insertion-ordered Map with expected constant-time lookup.
LinkedHashSet<E>
  A LinkedHashSet is a hash-table based Set implementation.
LinkedList<E extends LinkedListEntry<E>>
  A specialized double-linked list of elements that extends LinkedListEntry.
LinkedListEntry<E extends LinkedListEntry<E>>
  An object that can be an element in a LinkedList.
ListBase<E>
  Abstract implementation of a list.
ListQueue<E>
  List based Queue.
MapBase<K, V>
  Base class for implementing a Map.
MapView<K, V>
  Wrapper around a class that implements Map that only exposes `Map` members.
Queue<E>
  A Queue is a collection that can be manipulated at both ends. One can iterate over the elements of a queue through forEach or with an Iterator.
SetBase<E>
  Base implementation of Set.
SplayTreeMap<K, V>
  A Map of objects that can be ordered relative to each other.
SplayTreeSet<E>
  A Set of objects that can be ordered relative to each other.
UnmodifiableListView<E>
  An unmodifiable List view of another List.
UnmodifiableMapBase<K, V>
  Basic implementation of an unmodifiable Map.
UnmodifiableMapView<K, V>
  View of a Map that disallow modifying the map.
UnmodifiableSetView<E>
  An unmodifiable Set view of another Set.

## Extensions

IterableExtensions on Iterable<T>
  Operations on iterables.
NullableIterableExtensions on Iterable<T?>
  Operations on iterables with nullable elements.

## Typedefs

IterableBase<E> = Iterable<E>
  Base class for implementing Iterable.
IterableMixin<E> = Iterable<E>
  This Iterable mixin implements all Iterable members except `iterator`.
ListMixin<E> = ListBase<E>
  Base mixin implementation of a List class.
MapMixin<K, V> = MapBase<K, V>
  Mixin implementing a Map.
SetMixin<E> = SetBase<E>
  Mixin implementation of Set.