/// <summary>Create a ConcurrentHashSet with the elements in s.</summary> /// <remarks> /// Create a ConcurrentHashSet with the elements in s. /// This set has no maximum size. /// </remarks> public MaxSizeConcurrentHashSet(ICollection <E> s) { this.m = new ConcurrentHashMap <E, bool>(Math.Max(s.Count, 16)); Init(); Sharpen.Collections.AddAll(this, s); this.maxSize = -1; }
/// <summary>Create a ConcurrentHashSet with the maximum size given.</summary> public MaxSizeConcurrentHashSet(int maxSize) { // the keySet of the Map this.m = new ConcurrentHashMap <E, bool>(); this.maxSize = maxSize; Init(); }
private WordsCounter(string rootFolder) { _rootFolder = rootFolder; _counters = ConcurrentMap <string, Counter> .New(); }
private AtomicConcurrentMap(IConcurrentMap <Key, Value> target) { _ = target; }
public static IConcurrentMap <Key, Value> New(IConcurrentMap <Key, Value> target) { return (new AtomicConcurrentMap <Key, Value>(target)); }
public ConcurrentHashCounter(int initialCapacity) { map = new ConcurrentHashMap <E, AtomicDouble>(initialCapacity); totalCount = new AtomicDouble(); }