Beispiel #1
0
        void IWordsCounter.displayStatus()
        {
            var words = _counters.getKeys();

            Array.Sort(words);

            var total = 0;

            Console.WriteLine();

            foreach (var word in words)
            {
                var counter = _counters[word];
                var value   = counter.Value;

                total += value;

                Console.WriteLine($"{word, -15} {value, 5}");
            }

            Console.WriteLine();
            Console.WriteLine($"{"** total", -15} {total, 5}");
        }
Beispiel #2
0
 Key[] IConcurrentMap <Key, Value> .getKeys()
 {
     lock (_mutex) return(_.getKeys());
 }