public synchronized void decTaskCounter() {
   myCounter = Math.max(0, myCounter - 1);
   if (myCounter == 0) {
     notifyAll();
   }
 }
Ejemplo n.º 2
0
 /**
  * Converts a string into an integer hashcode.
  *
  * @param value string value.
  * @return integer hashcode.
  */
 public static int toHashCode(String value) {
   return Math.abs(
       Hashing.md5().newHasher().putString(value, Charset.forName("UTF8")).hash().asInt());
 }