Exemplo n.º 1
0
  public long decrement(T key, long count) {
    ensureKey(key);

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

    return count;
  }
Exemplo n.º 2
0
  public long increment(T key, long count) {
    ensureKey(key);

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

    return count;
  }