public void indexInsert ( int index , KType key ) { assert index < 0 : "The index must not point at an existing key." ; index = ~ index ; if ( Intrinsics . isEmpty ( key ) ) { assert index == mask + 1 ; assert Intrinsics . isEmpty ( keys [ index ] ) ; hasEmptyKey = true ; } else { assert Intrinsics . isEmpty ( keys [ index ] ) ; if ( assigned == resizeAt ) { allocateThenInsertThenRehash ( index , key ) ; } else { keys [ index ] = key ; } assigned ++ ; } }
Inserts a key for an index that is not present in the set . This method may help in avoiding double recalculation of the key s hash .