@SuppressWarnings("unchecked") public V put(K key,V value){
  final int hash=key.hashCode();
  int index=indexOf(key,hash);
  if (index >= 0) {
    index=(index << 1) + 1;
    final V old=(V)mArray[index];
    mArray[index]=value;
    return old;
  }
  index=~index;
  if (mSize >= mHashes.length) {
    final int n=mSize >= (BASE_SIZE * 2) ? (mSize + (mSize >> 1)) : (mSize >= BASE_SIZE ? (BASE_SIZE * 2) : BASE_SIZE);
    final int[] ohashes=mHashes;
    final Object[] oarray=mArray;
    allocArrays(n);
    if (mHashes.length > 0) {
      System.arraycopy(ohashes,0,mHashes,0,ohashes.length);
      System.arraycopy(oarray,0,mArray,0,oarray.length);
    }
    freeArrays(ohashes,oarray,mSize);
  }
  if (index < mSize) {
    System.arraycopy(mHashes,index,mHashes,index + 1,mSize - index);
    System.arraycopy(mArray,index << 1,mArray,(index + 1) << 1,(mSize - index) << 1);
  }
  mHashes[index]=hash;
  mArray[index << 1]=key;
  mArray[(index << 1) + 1]=value;
  mSize++;
  return null;
}

@ SuppressWarnings ( "unchecked" ) public V put ( K key , V value ) { final int hash = key . hashCode ( ) ; int index = indexOf ( key , hash ) ; if ( index >= 0 ) { index = ( index << 1 ) + 1 ; final V old = ( V ) mArray [ index ] ; mArray [ index ] = value ; return old ; } index = ~ index ; if ( mSize >= mHashes . length ) { final int n = mSize >= ( BASE_SIZE * 2 ) ? ( mSize + ( mSize > > 1 ) ) : ( mSize >= BASE_SIZE ? ( BASE_SIZE * 2 ) : BASE_SIZE ) ; final int [ ] ohashes = mHashes ; final Object [ ] oarray = mArray ; allocArrays ( n ) ; if ( mHashes . length > 0 ) { System . arraycopy ( ohashes , 0 , mHashes , 0 , ohashes . length ) ; System . arraycopy ( oarray , 0 , mArray , 0 , oarray . length ) ; } freeArrays ( ohashes , oarray , mSize ) ; } if ( index < mSize ) { System . arraycopy ( mHashes , index , mHashes , index + 1 , mSize - index ) ; System . arraycopy ( mArray , index << 1 , mArray , ( index + 1 ) << 1 , ( mSize - index ) << 1 ) ; } mHashes [ index ] = hash ; mArray [ index << 1 ] = key ; mArray [ ( index << 1 ) + 1 ] = value ; mSize ++ ; return null ; }
add a new value to the array map .
