protected void rehash ( final int newN ) { int i = 0 , pos ; final WorkbenchEntry [ ] workbenchEntry = this . workbenchEntry ; final int newMask = newN - 1 ; final WorkbenchEntry [ ] newWorkbenchEntry = new WorkbenchEntry [ newN ] ; for ( int j = size ; j -- != 0 ; ) { while ( workbenchEntry [ i ] == null ) i ++ ; WorkbenchEntry e = workbenchEntry [ i ] ; pos = hashCode ( e . ipAddress ) & newMask ; while ( newWorkbenchEntry [ pos ] != null ) pos = ( pos + 1 ) & newMask ; newWorkbenchEntry [ pos ] = e ; i ++ ; } n = newN ; mask = newMask ; maxFill = 3 * ( n / 4 ) ; this . workbenchEntry = newWorkbenchEntry ; }
Rehashes the set to a new size .