public static int hashArrayInsert ( final long [ ] srcArr , final long [ ] hashTable , final int lgArrLongs , final long thetaLong ) { int count = 0 ; final int arrLen = srcArr . length ; checkThetaCorruption ( thetaLong ) ; for ( int i = 0 ; i < arrLen ; i ++ ) { // scan source array, build target array final long hash = srcArr [ i ] ; checkHashCorruption ( hash ) ; if ( continueCondition ( thetaLong , hash ) ) { continue ; } if ( hashSearchOrInsert ( hashTable , lgArrLongs , hash ) < 0 ) { count ++ ; } } return count ; }
Inserts the given long array into the given hash table array of the target size removes any negative input values ignores duplicates and counts the values inserted . The given hash table may have values but they must have been inserted by this method or one of the other OADH insert methods in this class and they may not be dirty . This method performs additional checks against potentially invalid hash values or theta values . Returns the count of values actually inserted .