/** {@inheritDoc} */ protected void rehash( int newCapacity ) { int oldCapacity = _set.length; float oldSet[] = _set; byte oldStates[] = _states; _set = new float[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { float o = oldSet[i]; int index = insertKey(o); } } }
/** {@inheritDoc} */ public boolean add( float val ) { int index = insertKey(val); if ( index < 0 ) { return false; // already present in set, nothing to add } postInsertHook( consumeFreeSlot ); return true; // yes, we added something }
/** {@inheritDoc} */ protected void rehash( int newCapacity ) { int oldCapacity = _set.length; float oldSet[] = _set; byte oldStates[] = _states; _set = new float[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { float o = oldSet[i]; int index = insertKey(o); } } }
/** {@inheritDoc} */ @Override protected void rehash( int newCapacity ) { int oldCapacity = _set.length; float oldSet[] = _set; byte oldStates[] = _states; _set = new float[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { float o = oldSet[i]; int index = insertKey(o); } } }
/** {@inheritDoc} */ protected void rehash( int newCapacity ) { int oldCapacity = _set.length; float oldSet[] = _set; byte oldStates[] = _states; _set = new float[newCapacity]; _states = new byte[newCapacity]; for ( int i = oldCapacity; i-- > 0; ) { if( oldStates[i] == FULL ) { float o = oldSet[i]; int index = insertKey(o); } } }
/** {@inheritDoc} */ @Override public boolean add( float val ) { int index = insertKey(val); if ( index < 0 ) { return false; // already present in set, nothing to add } postInsertHook( consumeFreeSlot ); return true; // yes, we added something }
/** {@inheritDoc} */ public boolean add( float val ) { int index = insertKey(val); if ( index < 0 ) { return false; // already present in set, nothing to add } postInsertHook( consumeFreeSlot ); return true; // yes, we added something }
/** {@inheritDoc} */ public boolean add( float val ) { int index = insertKey(val); if ( index < 0 ) { return false; // already present in set, nothing to add } postInsertHook( consumeFreeSlot ); return true; // yes, we added something }