# StackedArray<T> class

Namespace: [Grasshopper2.Collections](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.collections.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class StackedArray<T> : IEnumerable<T>
```

Provides an immutable array-like collection optimised for frequent identical consecutive elements.

**Type parameters:**

- `T`

## Constructors

- [StackedArray<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/ctor.md): (5 overloads) Create a new, empty stacked array.

## Properties

- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/count.md): Gets the number of actual distinct values stored in this stacked array.
- [ImpliedCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/impliedcount.md): Gets the total length of all implied items in this stacked array.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/item.md): Gets the implied value (adjusted for accumulated valence) at the given index.

## Methods

- [GetEnumerator](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/getenumerator.md): Returns an enumerator that iterates through the collection of implied values.
- [ImpliedValue](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/impliedvalue.md): Gets the implied value (adjusted for accumulated valence) at the given index.
- [IEnumerable.GetEnumerator](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/system-collections-ienumerable-getenumerator.md): Returns an enumerator that iterates through the collection of implied values.
- [Valence](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/valence.md): Gets the valence of the value at the given index.
- [Value](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.stackedarray-1/value.md): Gets the value at the given index.
