Class ThreadSafeHashSet<T>
Inheritance
System.Object
ThreadSafeHashSet<T>
Implements
System.Collections.IEnumerable
System.Collections.Generic.IReadOnlySet<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.Generic.IReadOnlyCollection<T>
NetFabric.Hyperlinq.IValueEnumerable<T, System.Collections.Immutable.ImmutableHashSet.Enumerator<>>
Assembly: Eco.Core.dll
Syntax
public class ThreadSafeHashSet<T> : Object, IHashSet, IEnumerable, IReadOnlySet<T>, IEnumerable<T>, IReadOnlyCollection<T>, ISnapshotable<T>, ISnapshotable, IValueEnumerable<T, ImmutableHashSet<T>.Enumerator>
Type Parameters
Constructors
ThreadSafeHashSet()
Declaration
public ThreadSafeHashSet()
ThreadSafeHashSet(IEnumerable<T>)
Declaration
public ThreadSafeHashSet(IEnumerable<T> items)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
items |
|
Properties
Count
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
Snapshot
Declaration
public ImmutableHashSet<T> Snapshot { get; }
Property Value
Type |
Description |
System.Collections.Immutable.ImmutableHashSet<T> |
|
TypeName
Declaration
public string TypeName { get; }
Property Value
Type |
Description |
System.String |
|
Methods
Add(T)
Declaration
public virtual bool Add(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
Type |
Description |
System.Boolean |
|
AddRange(IEnumerable<T>)
Declaration
public virtual void AddRange(IEnumerable<T> e)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
e |
|
Clear()
Declaration
public virtual void Clear()
Contains(T)
Declaration
public bool Contains(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
Type |
Description |
System.Boolean |
|
Contains(IEnumerable<T>)
Declaration
public bool Contains(IEnumerable<T> items)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
items |
|
Returns
Type |
Description |
System.Boolean |
|
ContainsCast(Object)
Declaration
public bool ContainsCast(object item)
Parameters
Type |
Name |
Description |
System.Object |
item |
|
Returns
Type |
Description |
System.Boolean |
|
GetAndClear()
Declaration
public virtual ImmutableHashSet<T> GetAndClear()
Returns
Type |
Description |
System.Collections.Immutable.ImmutableHashSet<T> |
|
GetAndClearMatching(Func<T, Boolean>)
Declaration
public virtual IEnumerable<T> GetAndClearMatching(Func<T, bool> test)
Parameters
Type |
Name |
Description |
System.Func<T, System.Boolean> |
test |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
GetEnumerator()
Declaration
public ImmutableHashSet<T>.Enumerator GetEnumerator()
Returns
Type |
Description |
System.Collections.Immutable.ImmutableHashSet.Enumerator<> |
|
Remove(T)
Declaration
public virtual bool Remove(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Returns
Type |
Description |
System.Boolean |
|
RemoveAll(Func<T, Boolean>)
Removes all items matching match
predicate and returns count of removed items.
Declaration
public virtual int RemoveAll(Func<T, bool> match)
Parameters
Type |
Name |
Description |
System.Func<T, System.Boolean> |
match |
|
Returns
Type |
Description |
System.Int32 |
|
RemoveAllAndReturn(Func<T, Boolean>)
Remove from the hashset any entries passing the given match test, and return them.
Declaration
public virtual IEnumerable<T> RemoveAllAndReturn(Func<T, bool> match)
Parameters
Type |
Name |
Description |
System.Func<T, System.Boolean> |
match |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
RemoveRange(IEnumerable<T>)
Remove all items contained in range
if they are present in the hash set.
Declaration
public virtual void RemoveRange(IEnumerable<T> range)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
range |
|
RemoveRangeAndReturn(IEnumerable<T>)
Remove all items contained in range
if they are present in the hash set.
Declaration
public virtual IEnumerable<T> RemoveRangeAndReturn(IEnumerable<T> range)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
range |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
Items that were removed.
|
Set(IEnumerable<T>)
Declaration
public virtual void Set(IEnumerable<T> e)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
e |
|
Set(IEnumerable)
Declaration
public void Set(IEnumerable objs)
Parameters
Type |
Name |
Description |
System.Collections.IEnumerable |
objs |
|
SetEquals(IEnumerable<T>)
Declaration
public bool SetEquals(IEnumerable<T> other)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
other |
|
Returns
Type |
Description |
System.Boolean |
|
SnapshotAndClear()
Declaration
public IReadOnlySet<T> SnapshotAndClear()
Returns
Type |
Description |
System.Collections.Generic.IReadOnlySet<T> |
|
UnionWith(IEnumerable<T>)
Declaration
public virtual void UnionWith(IEnumerable<T> e)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
e |
|
Explicit Interface Implementations
IHashSet.Add(Object)
Declaration
void IHashSet.Add(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
IHashSet.Remove(Object)
Declaration
void IHashSet.Remove(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
ISnapshotable.Snapshot
Declaration
ICollection ISnapshotable.Snapshot { get; }
Returns
Type |
Description |
System.Collections.ICollection |
|
ISnapshotable<T>.Snapshot
Declaration
ICollection<T> ISnapshotable<T>.Snapshot { get; }
Returns
Type |
Description |
System.Collections.Generic.ICollection<T> |
|
Implements
System.Collections.IEnumerable
System.Collections.Generic.IReadOnlySet<>
System.Collections.Generic.IEnumerable<>
System.Collections.Generic.IReadOnlyCollection<>
NetFabric.Hyperlinq.IValueEnumerable<, >
Extension Methods