# Grasshopper2.Collections namespace

Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

## Classes

- [Accessor<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.accessor-1.md): Accessor for a specific array.
- [BoundedList<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.boundedlist-1.md): A list with a capped capacity which throws away the oldest element when newly added elements would cause a capacity overrun. This collection is threadsafe.
- [Buckets2D<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.buckets2d-1.md): Represents a two-dimensional array of rectangular spatial buckets. The buckets are anchored at an origin point (lower left corner of the region).
- [CircularArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.circulararray-1.md): Represents a threadsafe circular array. A circular array has a maximum length, but items can always be added to it efficiently. Once the capacity has been reached, newly added items override the oldest items.
- [ConcurrentList<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.concurrentlist-1.md): Provides very basic concurrent storage. This class is not high-performance.
- [DualArray<T1, T2>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.dualarray-2.md): Maintains and synchronizes two arrays. Note: this is probably useless now that Tuples are part of the lang.spec.
- [IdList<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idlist-1.md): A fast dictionary for objects with GUID keys. This type differs from Dictionary(Guid, T) by sacrificing memory for lookup performance. Adding entries may be slower and require more allocations, however finding entries ought to be slightly faster. This collection is not thread-safe and any modifying calls must be made from within a lock statement.
- [IdTable<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.idtable-1.md): A fast hashset for Guid keys.
- [IndexTable<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1.md): Maintains a set of values with unique integer indices (both negative and positive). Each index may be associated with one, and only one, value. This collection has O(1) lookup but expensive addition. Also, it will reserve memory for all potential entries between min(0, minimum index) and max(0, maximum index), so to conserve memory you should keep the used indices as small as possible. This collection is not threadsafe.
- [KeyedLists<TKey, T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.keyedlists-2.md): Represents a palette of keyed lists.
- [MultiDictionary<TKey, TValue>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.multidictionary-2.md): Provides a palette with multiple values per key. This class is not optimized for large overlaps of values.
- [MultiList<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.multilist-1.md): Provides access to a sequential collection of lists.
- [NamedListWithDefault<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.namedlistwithdefault-1.md): A list of named values with one unnamed value always available.
- [PriorityQueueIntDouble](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.priorityqueueintdouble.md): A specialized min-priority queue that stores (int Element, double Priority) pairs, always ordering by the smallest `Priority` first.
- [StackedArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1.md): Provides an immutable array-like collection optimised for frequent identical consecutive elements.
- [Subset<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.subset-1.md): Create a subset indexer for arrays.
- [TripleArray<T1, T2, T3>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.triplearray-3.md): Maintains and synchronizes three arrays. Note: this is probably useless now that Tuples are part of the lang.spec.
- [TypeFamily<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.typefamily-1.md): A collection of types with their associated IDs. This collection is designed to store a comprehensive list of all the implementations of a specific interface or base class for the purposes of (de)serialisation.
- [UndoList<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.undolist-1.md): Provides an undo/redo list mechanism.
- [ValenceSet<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.valenceset-1.md): Provides a hashset like type which also stores valences for entries. This collection is thread-safe for adding and removing, but not for enumerating.

## Structs

- [EitherOr<Ta, Tb>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.eitheror-2.md): A pair of values, only one of which is usually set.

## Enums

- [MultiDictionaryAddition](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.multidictionaryaddition.md): Enumerates the possible types of addition for multidictionaries.
