/** * Expands the set to accommodate new values. * * @param newCapacity an <code>int</code> value */ @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; int oldSize = size(); Object oldSet[] = _set; _set = new Object[newCapacity]; Arrays.fill( _set, FREE ); for ( int i = oldCapacity; i-- > 0; ) { E o = (E) oldSet[i]; if ( o != FREE && o != REMOVED ) { int index = insertKey( o ); if ( index < 0 ) { // everyone pays for this because some people can't RTFM throwObjectContractViolation( _set[( -index - 1 )], o, size(), oldSize, oldSet); } } } }
/** * Expands the set to accommodate new values. * * @param newCapacity an <code>int</code> value */ @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; Object oldSet[] = _set; _set = new Object[newCapacity]; Arrays.fill( _set, FREE ); for ( int i = oldCapacity; i-- > 0; ) { if ( oldSet[i] != FREE && oldSet[i] != REMOVED ) { E o = (E) oldSet[i]; int index = insertionIndex( o ); if ( index < 0 ) { // everyone pays for this because some people can't RTFM throwObjectContractViolation( _set[( -index - 1 )], o ); } _set[index] = o; } } }
/** * Expands the set to accommodate new values. * * @param newCapacity an <code>int</code> value */ @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; int oldSize = size(); Object oldSet[] = _set; _set = new Object[newCapacity]; Arrays.fill( _set, FREE ); for ( int i = oldCapacity; i-- > 0; ) { E o = (E) oldSet[i]; if ( o != FREE && o != REMOVED ) { int index = insertKey( o ); if ( index < 0 ) { // everyone pays for this because some people can't RTFM throwObjectContractViolation( _set[( -index - 1 )], o, size(), oldSize, oldSet); } } } }
/** * Expands the set to accommodate new values. * * @param newCapacity an <code>int</code> value */ @SuppressWarnings({"unchecked"}) protected void rehash( int newCapacity ) { int oldCapacity = _set.length; int oldSize = size(); Object oldSet[] = _set; _set = new Object[newCapacity]; Arrays.fill( _set, FREE ); for ( int i = oldCapacity; i-- > 0; ) { E o = (E) oldSet[i]; if ( o != FREE && o != REMOVED ) { int index = insertKey( o ); if ( index < 0 ) { // everyone pays for this because some people can't RTFM throwObjectContractViolation( _set[( -index - 1 )], o, size(), oldSize, oldSet); } } } }
/** * Expands the set to accommodate new values. * * @param newCapacity an <code>int</code> value */ @SuppressWarnings({"unchecked"}) @Override protected void rehash( int newCapacity ) { int oldCapacity = _set.length; int oldSize = size(); Object oldSet[] = _set; _set = new Object[newCapacity]; Arrays.fill( _set, FREE ); for ( int i = oldCapacity; i-- > 0; ) { E o = (E) oldSet[i]; if ( o != FREE && o != REMOVED ) { int index = insertKey( o ); if ( index < 0 ) { // everyone pays for this because some people can't RTFM throwObjectContractViolation( _set[( -index - 1 )], o, size(), oldSize, oldSet); } } } }