예제 #1
0
 /// <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;
 }
예제 #2
0
 /// <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();
 }
예제 #3
0
 private WordsCounter(string rootFolder)
 {
     _rootFolder = rootFolder;
     _counters   = ConcurrentMap <string, Counter> .New();
 }
예제 #4
0
 private AtomicConcurrentMap(IConcurrentMap <Key, Value> target)
 {
     _ = target;
 }
예제 #5
0
 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();
 }