Methods Summary |
---|
public static synchronized void | addAmount(int key, long amount)
//Now the method is synchronized, so we will always
//complete any particular update
vec[key] += amount;
|
public static synchronized long | getAmount(int key)
return vec[key];
|
public static synchronized void | initialize(int key)
vec[key] = 0;
|