# IndexTable<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 IndexTable<T>
```

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.

**Type parameters:**

- `T`

## Constructors

- [IndexTable<T>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/ctor.md): (2 overloads) Create a new empty table.

## Properties

- [All](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/all.md): Enumerate over all values, starting with the most negative index.
- [AllPairs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/allpairs.md): Enumerate over all values and index pairs, starting with the most negative index.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/count.md): Gets the number of defined values.
- [HighestNegativeUnusedIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/highestnegativeunusedindex.md): Gets the highest negative index which hasn't been assigned yet.
- [LowestPositiveUnusedIndex](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/lowestpositiveunusedindex.md): Gets the lowest positive index which hasn't been assigned yet.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/item.md): Gets the value at the given index. If the index doesn't exist, default(T) is returned.

## Methods

- [Contains](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/contains.md): Gets whether the specific index has been set.
- [Restore](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/restore.md): Restore a collection from an archive.
- [Set](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/set.md): Set the value at the given index. If the index is already taken, an exception will be thrown.
- [SetIfBlank](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/setifblank.md): Set the value at the given index. If the index is already taken, the new value will not be assigned.
- [SetOrOverwrite](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/setoroverwrite.md): Set the value at the given index. If the index is already taken, the old value will be overwritten.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/store.md): Store this collection.
- [TrimExcess](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/trimexcess.md): Remove the unneccessary memory allocations of this collection.
- [Wipe](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/wipe.md): Wipe a given index and value pair.
- [WipeAll](https://developer.rhino3d.com/api/gh2/type/grasshopper2.collections.indextable-1/wipeall.md): Wipe all index and value pairs.
