# AgnosticHashSet class

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

```cs
public sealed class AgnosticHashSet
```

A hashset which relies on type assistant based Write() comparison. This will be much slower than a System.Collections.Generic.HashSet for types which can be stored in it, but it's completely type-agnostic.

## Constructors

- [AgnosticHashSet](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/ctor.md): (2 overloads) Create an empty hash set.

## Properties

- [Cardinality](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/cardinality.md): Gets the number of elements (minus any null element) in this set.
- [CardinalityWithNull](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/cardinalitywithnull.md): Gets the number of elements (including the null element) in this set.
- [Elements](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/elements.md): Iterate over all elements in this set.
- [ElementsWithNull](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/elementswithnull.md): Iterate over all elements (inluding the null) in this set.
- [HasNull](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/hasnull.md): Gets whether this set contains a null value.

## Methods

- [Add](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/add.md): Add a pear to this hashset.
- [Contains](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/contains.md): Test if a pear exists in this set.
- [Remove](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.agnostichashset/remove.md): Remove a pear from this set.
