KS.Reactor.ksHashSet< T > Class Template Reference

A hash set with an event that fires when the hash set is modified. More...

Inheritance diagram for KS.Reactor.ksHashSet< T >:

Public Member Functions

delegate void ModifyHandler (ksHashSet< T > set)
 Set that was modified. More...
 
 ksHashSet ()
 Constructor. More...
 
 ksHashSet (IEnumerable< T > elements)
 Constructor. More...
 
bool Add (T element)
 Adds an element to the set if it is not already in the set. More...
 
void Add (params T[] elements)
 Adds elements to the set. More...
 
void Add (IEnumerable< T > elements)
 Adds elements to the set. More...
 
bool Remove (T element)
 Removes an element from the set. More...
 
void Remove (params T[] elements)
 Removes elements from the set. More...
 
void Remove (IEnumerable< T > elements)
 Removes elements from the set. More...
 
void Set (params T[] elements)
 Clears the set and adds the given elements. More...
 
void Set (IEnumerable< T > elements)
 Clears the set and adds the given elements. More...
 
void Clear ()
 Clears the set. More...
 
bool Contains (T element)
 Checks if the set contains an element? More...
 
bool ContainsAll (params T[] elements)
 Checks if the set contains all of the given elements. More...
 
bool ContainsAll (IEnumerable< T > elements)
 Checks if the set contains all of the given elements. More...
 
bool ContainsAny (params T[] elements)
 Checks if the set contains any of the given elements. More...
 
bool ContainsAny (IEnumerable< T > elements)
 Checks if the set contains any of the given elements. More...
 
void CopyTo (T[] array, int arrayIndex)
 Copies the set elements into an array. More...
 
HashSet< T >.Enumerator GetEnumerator ()
 Gets the enumerator. More...
 

Public Attributes

ModifyHandler OnModify
 Invoked when the hash set is modified. More...
 

Properties

int Count [get]
 The number of elements in the set. More...
 
bool IsReadOnly [get]
 Is this collection read-only? Always false. More...
 

Detailed Description

A hash set with an event that fires when the hash set is modified.

Template Parameters
T

Constructor & Destructor Documentation

◆ ksHashSet() [1/2]

Constructor.

◆ ksHashSet() [2/2]

KS.Reactor.ksHashSet< T >.ksHashSet ( IEnumerable< T >  elements)

Constructor.

Parameters
elementsElements to initialize the set with.

Member Function Documentation

◆ Add() [1/3]

void KS.Reactor.ksHashSet< T >.Add ( IEnumerable< T >  elements)

Adds elements to the set.

Parameters
elementsElements to add.

◆ Add() [2/3]

void KS.Reactor.ksHashSet< T >.Add ( params T[]  elements)

Adds elements to the set.

Parameters
elementsElements to add.

◆ Add() [3/3]

bool KS.Reactor.ksHashSet< T >.Add ( element)

Adds an element to the set if it is not already in the set.

Parameters
elementElement to add.
Returns
True if the element was added. False if it was already in the set.

◆ Clear()

void KS.Reactor.ksHashSet< T >.Clear ( )

Clears the set.

◆ Contains()

bool KS.Reactor.ksHashSet< T >.Contains ( element)

Checks if the set contains an element?

Parameters
elementElement to check for.
Returns
True if the element is in the set.

◆ ContainsAll() [1/2]

bool KS.Reactor.ksHashSet< T >.ContainsAll ( IEnumerable< T >  elements)

Checks if the set contains all of the given elements.

Parameters
elementsElements to check for.
Returns
True if all of the elements are in the set.

◆ ContainsAll() [2/2]

bool KS.Reactor.ksHashSet< T >.ContainsAll ( params T[]  elements)

Checks if the set contains all of the given elements.

Parameters
elementsElements to check for.
Returns
True if all of the elements are in the set.

◆ ContainsAny() [1/2]

bool KS.Reactor.ksHashSet< T >.ContainsAny ( IEnumerable< T >  elements)

Checks if the set contains any of the given elements.

Parameters
elementsElements to check for.
Returns
True if any of the elements are in the set.

◆ ContainsAny() [2/2]

bool KS.Reactor.ksHashSet< T >.ContainsAny ( params T[]  elements)

Checks if the set contains any of the given elements.

Parameters
elementsElements to check for.
Returns
True if any of the elements are in the set.

◆ CopyTo()

void KS.Reactor.ksHashSet< T >.CopyTo ( T[]  array,
int  arrayIndex 
)

Copies the set elements into an array.

Parameters
arrayArray to copy elements into.
arrayIndexArray index to start copying to.

◆ GetEnumerator()

HashSet<T>.Enumerator KS.Reactor.ksHashSet< T >.GetEnumerator ( )

Gets the enumerator.

Returns

◆ ModifyHandler()

delegate void KS.Reactor.ksHashSet< T >.ModifyHandler ( ksHashSet< T >  set)

Set that was modified.

Parameters
set

◆ Remove() [1/3]

void KS.Reactor.ksHashSet< T >.Remove ( IEnumerable< T >  elements)

Removes elements from the set.

Parameters
elementsElements to remove.

◆ Remove() [2/3]

void KS.Reactor.ksHashSet< T >.Remove ( params T[]  elements)

Removes elements from the set.

Parameters
elementsElements to remove.

◆ Remove() [3/3]

bool KS.Reactor.ksHashSet< T >.Remove ( element)

Removes an element from the set.

Parameters
elementElement to remove.
Returns
True if the element was removed. False if the element was not in the set.

◆ Set() [1/2]

void KS.Reactor.ksHashSet< T >.Set ( IEnumerable< T >  elements)

Clears the set and adds the given elements.

Parameters
elements

◆ Set() [2/2]

void KS.Reactor.ksHashSet< T >.Set ( params T[]  elements)

Clears the set and adds the given elements.

Parameters
elements

Member Data Documentation

◆ OnModify

Invoked when the hash set is modified.

Property Documentation

◆ Count

int KS.Reactor.ksHashSet< T >.Count
get

The number of elements in the set.

◆ IsReadOnly

bool KS.Reactor.ksHashSet< T >.IsReadOnly
get

Is this collection read-only? Always false.