示例#1
0
        public Counter <T> Add(T obj, long countValue)
        {
            if (!map.TryGetValue(obj, out RWLong count))
            {
                map[obj] = count = new RWLong();
            }

            count.value += countValue;
            return(this);
        }
示例#2
0
        public Counter <T> Add(T obj, long countValue)
        {
            RWLong count = map.Get(obj);

            if (count == null)
            {
                map[obj] = count = new RWLong();
            }
            count.value += countValue;
            return(this);
        }
示例#3
0
 public Entry(RWLong count, T value, int uniqueness)
 {
     this.count      = count;
     this.value      = value;
     this.uniqueness = uniqueness;
 }
示例#4
0
        public long Get(T obj)
        {
            RWLong count = map.Get(obj);

            return(count == null ? 0 : count.value);
        }