public boolean add ( final WorkbenchEntry e ) { // The starting point. int pos = hashCode ( e . ipAddress ) & mask ; // There's always an unused entry. while ( workbenchEntry [ pos ] != null ) { if ( Arrays . equals ( workbenchEntry [ pos ] . ipAddress , e . ipAddress ) ) return false ; pos = ( pos + 1 ) & mask ; } workbenchEntry [ pos ] = e ; if ( ++ size >= maxFill && n < ( 1 << 30 ) ) rehash ( 2 * n ) ; return true ; }
Adds a workbench entry to the set if necessary .