/** {@inheritDoc} */ @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; long oldKeys[] = _set; V oldVals[] = _values; byte oldStates[] = _states; _set = new long[newCapacity]; _values = (V[]) new Object[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { long o = oldKeys[i]; int index = insertKey(o); _values[index] = oldVals[i]; } } }
/** {@inheritDoc} */ public V put( long key, V value ) { int index = insertKey( key ); return doPut( value, index ); }
/** {@inheritDoc} */ public V putIfAbsent( long key, V value ) { int index = insertKey( key ); if ( index < 0 ) return _values[-index - 1]; return doPut( value, index ); }
/** {@inheritDoc} */ @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; long oldKeys[] = _set; V oldVals[] = _values; byte oldStates[] = _states; _set = new long[newCapacity]; _values = (V[]) new Object[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { long o = oldKeys[i]; int index = insertKey(o); _values[index] = oldVals[i]; } } }
/** {@inheritDoc} */ @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; long oldKeys[] = _set; V oldVals[] = _values; byte oldStates[] = _states; _set = new long[newCapacity]; _values = (V[]) new Object[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { long o = oldKeys[i]; int index = insertKey(o); _values[index] = oldVals[i]; } } }
/** {@inheritDoc} */ @Override @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; long oldKeys[] = _set; V oldVals[] = _values; byte oldStates[] = _states; _set = new long[newCapacity]; _values = (V[]) new Object[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { long o = oldKeys[i]; int index = insertKey(o); _values[index] = oldVals[i]; } } }
/** {@inheritDoc} */ public V putIfAbsent( long key, V value ) { int index = insertKey( key ); if ( index < 0 ) return _values[-index - 1]; return doPut( value, index ); }
/** {@inheritDoc} */ public V putIfAbsent( long key, V value ) { int index = insertKey( key ); if ( index < 0 ) return _values[-index - 1]; return doPut( value, index ); }
/** {@inheritDoc} */ public V put( long key, V value ) { int index = insertKey( key ); return doPut( value, index ); }
/** {@inheritDoc} */ @Override public V putIfAbsent( long key, V value ) { int index = insertKey( key ); if ( index < 0 ) return _values[-index - 1]; return doPut( value, index ); }
/** {@inheritDoc} */ public V put( long key, V value ) { int index = insertKey( key ); return doPut( value, index ); }
/** {@inheritDoc} */ @Override public V put( long key, V value ) { int index = insertKey( key ); return doPut( value, index ); }