public void put(String key,int value){
  int hash=(key.hashCode() & 0x7FFFFFFF) % HASHTABLE_SIZE;
  Object[] bucket=fHashTable[hash];
  if (bucket == null) {
    bucket=new Object[1 + 2 * INITIAL_BUCKET_SIZE];
    bucket[0]=new int[]{1};
    bucket[1]=key;
    bucket[2]=new int[]{value};
    fHashTable[hash]=bucket;
  }
 else {
    int count=((int[])bucket[0])[0];
    int offset=1 + 2 * count;
    if (offset == bucket.length) {
      int newSize=count + INITIAL_BUCKET_SIZE;
      Object[] newBucket=new Object[1 + 2 * newSize];
      System.arraycopy(bucket,0,newBucket,0,offset);
      bucket=newBucket;
      fHashTable[hash]=bucket;
    }
    boolean found=false;
    int j=1;
    for (int i=0; i < count; i++) {
      if (bucket[j] == key) {
        ((int[])bucket[j + 1])[0]=value;
        found=true;
        break;
      }
      j+=2;
    }
    if (!found) {
      bucket[offset++]=key;
      bucket[offset]=new int[]{value};
      ((int[])bucket[0])[0]=++count;
    }
  }
}

public void put ( String key , int value ) { int hash = ( key . hashCode ( ) & 0x7FFFFFFF ) % HASHTABLE_SIZE ; Object [ ] bucket = fHashTable [ hash ] ; if ( bucket == null ) { bucket = new Object [ 1 + 2 * INITIAL_BUCKET_SIZE ] ; bucket [ 0 ] = new int [ ] { 1 } ; bucket [ 1 ] = key ; bucket [ 2 ] = new int [ ] { value } ; fHashTable [ hash ] = bucket ; } else { int count = ( ( int [ ] ) bucket [ 0 ] ) [ 0 ] ; int offset = 1 + 2 * count ; if ( offset == bucket . length ) { int newSize = count + INITIAL_BUCKET_SIZE ; Object [ ] newBucket = new Object [ 1 + 2 * newSize ] ; System . arraycopy ( bucket , 0 , newBucket , 0 , offset ) ; bucket = newBucket ; fHashTable [ hash ] = bucket ; } boolean found = false ; int j = 1 ; for ( int i = 0 ; i < count ; i ++ ) { if ( bucket [ j ] == key ) { ( ( int [ ] ) bucket [ j + 1 ] ) [ 0 ] = value ; found = true ; break ; } j += 2 ; } if ( ! found ) { bucket [ offset ++ ] = key ; bucket [ offset ] = new int [ ] { value } ; ( ( int [ ] ) bucket [ 0 ] ) [ 0 ] = ++ count ; } } }
associates the given value with the specified key tuple .
