@Override public V put(K key,V value){
  poll();
  int index=0;
  Entry<K,V> entry;
  if (key != null) {
    index=(Collections.secondaryHash(key) & 0x7FFFFFFF) % elementData.length;
    entry=elementData[index];
    while (entry != null && !key.equals(entry.get())) {
      entry=entry.next;
    }
  }
 else {
    entry=elementData[0];
    while (entry != null && !entry.isNull) {
      entry=entry.next;
    }
  }
  if (entry == null) {
    modCount++;
    if (++elementCount > threshold) {
      rehash();
      index=key == null ? 0 : (Collections.secondaryHash(key) & 0x7FFFFFFF) % elementData.length;
    }
    entry=new Entry<K,V>(key,value,referenceQueue);
    entry.next=elementData[index];
    elementData[index]=entry;
    return null;
  }
  V result=entry.value;
  entry.value=value;
  return result;
}

@ Override public V put ( K key , V value ) { poll ( ) ; int index = 0 ; Entry < K , V > entry ; if ( key != null ) { index = ( Collections . secondaryHash ( key ) & 0x7FFFFFFF ) % elementData . length ; entry = elementData [ index ] ; while ( entry != null && ! key . equals ( entry . get ( ) ) ) { entry = entry . next ; } } else { entry = elementData [ 0 ] ; while ( entry != null && ! entry . isNull ) { entry = entry . next ; } } if ( entry == null ) { modCount ++ ; if ( ++ elementCount > threshold ) { rehash ( ) ; index = key == null ? 0 : ( Collections . secondaryHash ( key ) & 0x7FFFFFFF ) % elementData . length ; } entry = new Entry < K , V > ( key , value , referenceQueue ) ; entry . next = elementData [ index ] ; elementData [ index ] = entry ; return null ; } V result = entry . value ; entry . value = value ; return result ; }
maps the specified key to the specified value .
