示例#1
0
 /**
  * Set value if smaller than the current value
  *
  * @param t
  * @param count
  */
 public synchronized void setIfSmaller(T t, long count) {
   if (get(t) > count) {
     set(t, count);
   }
 }
示例#2
0
 /**
  * Set value if larger than the current value
  *
  * @param t
  * @param count
  */
 public synchronized void setIfBigger(T t, long count) {
   if (get(t) < count) {
     set(t, count);
   }
 }