protected void rehash(){
  int oldCapacity=table.length;
  CacheEntry oldTable[]=table;
  int newCapacity=oldCapacity * 2 + 1;
  CacheEntry newTable[]=new CacheEntry[newCapacity];
  threshold=(int)(newCapacity * loadFactor);
  table=newTable;
  for (int i=oldCapacity; i-- > 0; ) {
    for (CacheEntry old=oldTable[i]; old != null; ) {
      CacheEntry e=old;
      old=old.next;
      if (e.check() != null) {
        int index=(e.hash & 0x7FFFFFFF) % newCapacity;
        e.next=newTable[index];
        newTable[index]=e;
      }
 else       count--;
    }
  }
}

protected void rehash ( ) { int oldCapacity = table . length ; CacheEntry oldTable [ ] = table ; int newCapacity = oldCapacity * 2 + 1 ; CacheEntry newTable [ ] = new CacheEntry [ newCapacity ] ; threshold = ( int ) ( newCapacity * loadFactor ) ; table = newTable ; for ( int i = oldCapacity ; i -- > 0 ; ) { for ( CacheEntry old = oldTable [ i ] ; old != null ; ) { CacheEntry e = old ; old = old . next ; if ( e . check ( ) != null ) { int index = ( e . hash & 0x7FFFFFFF ) % newCapacity ; e . next = newTable [ index ] ; newTable [ index ] = e ; } else count -- ; } } }
rehashes the contents of the table into a bigger table . this is method is called automatically when the cache ' s size exceeds the threshold .
