예제 #1
0
  public long decrement(T key, long count) {
    ensureKey(key);

    count = map.get(key) - count;
    map.put(key, count);
    total -= count;

    return count;
  }
예제 #2
0
  public long increment(T key, long count) {
    ensureKey(key);

    count = map.get(key) + count;
    map.put(key, count);
    total += count;

    return count;
  }