public synchronized boolean addUnique ( int key , int value ) { if ( count == capacity ) { if ( fixedSize ) { return false ; } else { doubleCapacity ( ) ; } } if ( ! sorted ) { fastQuickSort ( ) ; } targetSearchValue = sortOnValues ? value : key ; int i = binaryEmptySlotSearch ( ) ; if ( i == - 1 ) { return false ; } hasChanged = true ; if ( count != i ) { moveRows ( i , i + 1 , count - i ) ; } keys [ i ] = key ; values [ i ] = value ; count ++ ; return true ; }
Adds a pair ensuring no duplicate key xor value already exists in the current search target column .