ConcurrentHashSet<T> - класс

Represents a thread-safe hash-based unique collection.

Definition

Пространство имён: Tessa.Platform.Collections
Сборка: Tessa (в Tessa.dll) Версия: 4.0.6
C#
public class ConcurrentHashSet<T> : IReadOnlyCollection<T>, 
	IEnumerable<T>, IEnumerable, ICollection<T>
Inheritance
Object    ConcurrentHashSet<T>
Implements
ICollection<T>, IEnumerable<T>, IReadOnlyCollection<T>, IEnumerable

Параметры типа

T
The type of the items in the collection.

Заметки

All public members of ConcurrentHashSet<T> are thread-safe and may be used concurrently from multiple threads.

Конструкторы

ConcurrentHashSet<T>() Initializes a new instance of the ConcurrentHashSet<T> class that is empty, has the default concurrency level, has the default initial capacity, and uses the default comparer for the item type.
ConcurrentHashSet<T>(IEnumerable<T>) Initializes a new instance of the ConcurrentHashSet<T> class that contains elements copied from the specified IEnumerable<T>, has the default concurrency level, has the default initial capacity, and uses the default comparer for the item type.
ConcurrentHashSet<T>(IEqualityComparer<T>) Initializes a new instance of the ConcurrentHashSet<T> class that is empty, has the specified concurrency level and capacity, and uses the specified IEqualityComparer<T>.
ConcurrentHashSet<T>(IEnumerable<T>, IEqualityComparer<T>) Initializes a new instance of the ConcurrentHashSet<T> class that contains elements copied from the specified IEnumerable, has the default concurrency level, has the default initial capacity, and uses the specified IEqualityComparer<T>.
ConcurrentHashSet<T>(Int32, Int32) Initializes a new instance of the ConcurrentHashSet<T> class that is empty, has the specified concurrency level and capacity, and uses the default comparer for the item type.
ConcurrentHashSet<T>(Int32, IEnumerable<T>, IEqualityComparer<T>) Initializes a new instance of the ConcurrentHashSet<T> class that contains elements copied from the specified IEnumerable, has the specified concurrency level, has the specified initial capacity, and uses the specified IEqualityComparer<T>.
ConcurrentHashSet<T>(Int32, Int32, IEqualityComparer<T>) Initializes a new instance of the ConcurrentHashSet<T> class that is empty, has the specified concurrency level, has the specified initial capacity, and uses the specified IEqualityComparer<T>.

Свойства

Comparer Gets the IEqualityComparer<T> that is used to determine equality for the values in the set.
Count Gets the number of items contained in the ConcurrentHashSet<T>.
IsEmpty Gets a value that indicates whether the ConcurrentHashSet<T> is empty.

Методы

Add Adds the specified item to the ConcurrentHashSet<T>.
Clear Removes all items from the ConcurrentHashSet<T>.
Contains Determines whether the ConcurrentHashSet<T> contains the specified item.
EqualsDetermines whether the specified object is equal to the current object.
(Унаследован от Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Унаследован от Object)
GetEnumeratorReturns a value-type enumerator that iterates through the ConcurrentHashSet<T>.
GetHashCodeServes as the default hash function.
(Унаследован от Object)
GetTypeGets the Type of the current instance.
(Унаследован от Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Унаследован от Object)
ToArray 
ToStringReturns a string that represents the current object.
(Унаследован от Object)
TryGetValue Searches the ConcurrentHashSet<T> for a given value and returns the equal value it finds, if any.
TryRemove Attempts to remove the item from the ConcurrentHashSet<T>.

Методы расширения

AddRange<T> Добавляет значения items в коллекцию collection.
(Определяется CollectionsExtensions)
AddRange<T> Добавляет значения items в коллекцию collection.
(Определяется CollectionsExtensions)
AllOrNull<T> Определяет отвечают ли все элементы последовательности переданному предикату.
(Определяется PlatformExtensions)
AsArray<T> Преобразует коллекцию в массив. В случае, если коллекция не является массивом, к ней применяется ToArray<TSource>(IEnumerable<TSource>).
(Определяется CollectionsExtensions)
AsReadOnlyCollection<T> Преобразует перечисление в коллекцию, доступную только для чтения. В случае, если перечисление не является коллекцией IReadOnlyCollection<T>, но является объектом IList<T>, тогда создаётся объект ReadOnlyCollection<T>, иначе к нему применяется ToImmutableList<TSource>(IEnumerable<TSource>).
(Определяется CollectionsExtensions)
ConvertToListDictionaries<T> Осуществляет сопоставлению коллекции source на коллекцию коллекций ключ-значение в соответствии с контекстом сопоставления по умолчанию
(Определяется DictionaryConverter)
ConvertToListDictionaries<T> Осуществляет сопоставлению коллекции source на коллекцию коллекций ключ-значение в соответствии с контекстом сопоставления context
(Определяется DictionaryConverter)
ForEach<T> Выполняет указанное действие с каждым элементом коллекции IEnumerable<T>.
(Определяется CollectionsExtensions)
FullOuterJoin<T, TInner, TKey, TResult> Объединяет две последовательности по алгоритму FULL OUTER JOIN.
(Определяется CollectionsExtensions)
Get
(Определяется ComHelper)
IndexOf<T> Возвращает индекс первого вхождения элемента в последовательность, определяемый посредством заданного выражения.
(Определяется CollectionsExtensions)
IndexOf<T> Возвращает индекс первого вхождения элемента в последовательность, определяемый посредством заданного компаратора IEqualityComparer<T>.
(Определяется CollectionsExtensions)
Invoke
(Определяется ComHelper)
OrderByAttributeAndType<T>

Сортирует элементы с учётом атрибута OrderAttribute на типах объектов.

Если атрибут отсутствует или элемент равен null - подразумевается 0. Если несколько зависимостей имеют одинаковый порядок, то они сортируются по краткому имени типа элемента (без пространства имён), а при его совпадении - по квалифицированному имени типа (с учётом пространства имён и названия сборки).


(Определяется PlatformExtensions)
OrderByDbmsBase<T> Метод для сортировки списка в порядке по возрастанию с учётом особенностей СУБД.
(Определяется DataExtensions)
OrderByDependencies<T>
(Определяется CollectionsExtensions)
OrderByDependencies<T>
(Определяется CollectionsExtensions)
OrderByDependencies<T, TKey>
(Определяется CollectionsExtensions)
OrderByDependencies<T, TKey>
(Определяется CollectionsExtensions)
OrderByDescendingDbmsBase<T> Метод для сортировки списка в порядке по убыванию с учётом особенностей СУБД.
(Определяется DataExtensions)
OrderByLocalized<T> Сортирует значения последовательности по возрастанию по локализованному ключу, который определяется для каждого элемента.
(Определяется PlatformExtensions)
OrderByLocalizedDescending<T> Сортирует значения последовательности по убыванию по локализованному ключу, который определяется для каждого элемента.
(Определяется PlatformExtensions)
RemoveRange<T> Удаляет значения items из коллекции collection.
(Определяется CollectionsExtensions)
RemoveRange<T> Удаляет значения items из коллекции collection.
(Определяется CollectionsExtensions)
RunWithMaxDegreeOfParallelismAsync<T> Выполняет асинхронную обработку элементов с ограничением на максимальное количество параллельных задач.
(Определяется PlatformExtensions)
Set
(Определяется ComHelper)
ToDictionaryAsync<T, TKey, TElement> Создает словарь Dictionary<TKey, TValue> из объекта IEnumerable<T> в соответствии с заданными функциями синхронного селектора ключа и асинхронного селектора значения.
(Определяется PlatformExtensions)
ToObservableCollection<T> Преобразует коллекцию IEnumerable в ObservableCollection
(Определяется CollectionsExtensions)
ToSealableList<T> Возвращает список объектов, поддерживающий защиту от изменений. Каждый из объектов T в списке либо не реализует интерфейс ISealable, либо защита от изменений таких объектов не активируется вместе со списком.
(Определяется CollectionsExtensions)
TryFirst<T> Возвращает первый элемент последовательности, удовлетворяющий условию.
(Определяется CollectionsExtensions)
TrySingleOrDefault<T> Возвращает единственный конкретный элемент коллекции или значение по умолчанию для типа, если этот элемент не найден.
(Определяется CollectionsExtensions)
WithPreviousAndNext<T>
(Определяется EnumerableExtensions)

См. также