AgnosticHashSet

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

#
public AgnosticHashSet()
Create an empty hash set.

AgnosticHashSet

#
public AgnosticHashSet(ITwig twig)
Create a set out of a twig.
twig (ITwig)

Properties

Cardinality

#
public int Cardinality { get; }
Gets the number of elements (minus any null element) in this set.

CardinalityWithNull

#
public int CardinalityWithNull { get; }
Gets the number of elements (including the null element) in this set.

Elements

#
public IEnumerable<IPear> Elements { get; }
Iterate over all elements in this set.

ElementsWithNull

#
public IEnumerable<IPear> ElementsWithNull { get; }
Iterate over all elements (inluding the null) in this set.

HasNull

#
public bool HasNull { get; }
Gets whether this set contains a null value.

Methods

Add

#
public bool Add(IPear pear)
Add a pear to this hashset.
pear (IPear)
True if the pear was added, false if it already existed.

Contains

#
public bool Contains(IPear pear)
Test if a pear exists in this set.
pear (IPear)

Remove

#
public bool Remove(IPear pear)
Remove a pear from this set.
pear (IPear)
True if it was removed.