Exemplo n.º 1
0
 /**
  * Removes entry having key k from bucket with hash value h, returning the previously associated
  * value, if found.
  *
  * @param h the hash value of the relevant bucket
  * @param k the key of interest
  * @return previous value associated with k (or null, if no such entry)
  */
 @Override
 protected V bucketRemove(int h, K k) {
   UnsortedTableMap<K, V> bucket = table[h];
   if (bucket == null) return null;
   int oldSize = bucket.size();
   V answer = bucket.remove(k);
   n -= (oldSize - bucket.size()); // size may have decreased
   return answer;
 }