synchronized public void set ( Element value ) { int bind = ( ( int ) value . getIndex ( ) & Integer . MAX_VALUE ) % buckets . length ; Element [ ] bucket = buckets [ bind ] ; int count = counts [ bind ] ; if ( bucket == null ) buckets [ bind ] = bucket = new Element [ initBucketSize ] ; else if ( bucket . length == count ) { bucket = new Element [ count * 2 ] ; System . arraycopy ( buckets [ bind ] , 0 , bucket , 0 , count ) ; buckets [ bind ] = bucket ; } bucket [ count ] = value ; counts [ bind ] = count + 1 ; totalSize += 1 ; }
Set an element into the array