Class ConcurrentSet<T>
Concurent implementation HasSet comes from:
https://stackoverflow.com/questions/18922985/concurrent-hashsett-in-net-framework
https://stackoverflow.com/questions/4306936/how-to-implement-concurrenthashset-in-net
Inherited Members
Namespace: AXSharp.Connector
Assembly: AXSharp.Connector.dll
Syntax
public class ConcurrentSet<T> : ISet<T>, ICollection<T>, IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T |
Properties
| Edit this page View SourceCount
Gets the number of elements in the set.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
IsEmpty
Gets a value that indicates if the set is empty.
Declaration
public bool IsEmpty { get; }
Property Value
Type | Description |
---|---|
bool |
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool | true if the ICollection<T> is read-only; otherwise, false. |
Values
Declaration
public ICollection<T> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<T> |
Methods
| Edit this page View SourceAdd(T)
Adds an element to the current set and returns a value to indicate if the element was successfully added.
Declaration
public bool Add(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The element to add to the set. |
Returns
Type | Description |
---|---|
bool | true if the element is added to the set; false if the element is already in the set. |
Clear()
Removes all items from the ICollection<T>.
Declaration
public void Clear()
Exceptions
Type | Condition |
---|---|
NotSupportedException | The ICollection<T> is read-only. |
Contains(T)
Determines whether the ICollection<T> contains a specific value.
Declaration
public bool Contains(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to locate in the ICollection<T>. |
Returns
Type | Description |
---|---|
bool | true if |
CopyTo(T[], int)
Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing. |
int | arrayIndex | The zero-based index in |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException |
|
ExceptWith(IEnumerable<T>)
Removes all elements in the specified collection from the current set.
Declaration
public void ExceptWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection of items to remove from the set. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<T> | A IEnumerator<T> that can be used to iterate through the collection. |
IntersectWith(IEnumerable<T>)
Modifies the current set so that it contains only elements that are also in a specified collection.
Declaration
public void IntersectWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsProperSubsetOf(IEnumerable<T>)
Determines whether the current set is a property (strict) subset of a specified collection.
Declaration
public bool IsProperSubsetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool | true if the current set is a correct subset of |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsProperSupersetOf(IEnumerable<T>)
Determines whether the current set is a correct superset of a specified collection.
Declaration
public bool IsProperSupersetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool | true if the ISet<T> object is a correct superset of |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsSubsetOf(IEnumerable<T>)
Determines whether a set is a subset of a specified collection.
Declaration
public bool IsSubsetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool | true if the current set is a subset of |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
IsSupersetOf(IEnumerable<T>)
Determines whether the current set is a superset of a specified collection.
Declaration
public bool IsSupersetOf(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool | true if the current set is a superset of |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Overlaps(IEnumerable<T>)
Determines whether the current set overlaps with the specified collection.
Declaration
public bool Overlaps(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool | true if the current set and |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Remove(T)
Removes the first occurrence of a specific object from the ICollection<T>.
Declaration
public bool Remove(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to remove from the ICollection<T>. |
Returns
Type | Description |
---|---|
bool | true if |
Exceptions
Type | Condition |
---|---|
NotSupportedException | The ICollection<T> is read-only. |
SetEquals(IEnumerable<T>)
Determines whether the current set and the specified collection contain the same elements.
Declaration
public bool SetEquals(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Returns
Type | Description |
---|---|
bool | true if the current set is equal to |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SymmetricExceptWith(IEnumerable<T>)
Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both.
Declaration
public void SymmetricExceptWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ToArray()
Declaration
public T[] ToArray()
Returns
Type | Description |
---|---|
T[] |
TryAdd(T)
Declaration
public bool TryAdd(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
bool |
TryRemove(T)
Declaration
public bool TryRemove(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
bool |
UnionWith(IEnumerable<T>)
Modifies the current set so that it contains all elements that are present in both the current set and in the specified collection.
Declaration
public void UnionWith(IEnumerable<T> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<T> | other | The collection to compare to the current set. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|