public void remove() { if( _prev == -1 ) throw new IllegalStateException(); _nbsi2.remove(_prev); _prev = -1; } }
public void remove() { if( _prev == -1 ) throw new IllegalStateException(); _nbsi2.remove(_prev); _prev = -1; } }
public boolean remove( final int i ) { if( (i>>6) >= _bits.length ) // Out of bounds? Not in this array! return _new != null && help_copy().remove(i); // Handle every 64th bit via using a nested array NBSI nbsi = this; // The bit array being added into int j = i; // The bit index being added while( (j&63) == 63 ) { // Bit 64? (low 6 bits are all set) nbsi = nbsi._nbsi64; // Recurse j = j>>6; // Strip off low 6 bits (all set) } final long mask = mask(j); long old; do { old = nbsi._bits[j>>6]; // Read old bits if( old < 0 ) // Not mutable? // Not mutable: finish copy of word, and retry on copied word return help_copy_impl(i).help_copy().remove(i); if( (old & mask) == 0 ) return false; // Bit is already clear? } while( !nbsi.CAS( j>>6, old, old & ~mask ) ); _size.add(-1); return true; }
/** * Remove {@code i} from the set. This is the fast lower-case '{@code int}' * version of {@link #remove} - no autoboxing. * @return <tt>true</tt> if i was added to the set. */ public boolean remove ( final int i ) { return i >= 0 && _nbsi.remove(i); }
public boolean remove( final int i ) { if( (i>>6) >= _bits.length ) // Out of bounds? Not in this array! return _new != null && help_copy().remove(i); // Handle every 64th bit via using a nested array NBSI nbsi = this; // The bit array being added into int j = i; // The bit index being added while( (j&63) == 63 ) { // Bit 64? (low 6 bits are all set) nbsi = nbsi._nbsi64; // Recurse j = j>>6; // Strip off low 6 bits (all set) } final long mask = mask(j); long old; do { old = nbsi._bits[j>>6]; // Read old bits if( old < 0 ) // Not mutable? // Not mutable: finish copy of word, and retry on copied word return help_copy_impl(i).help_copy().remove(i); if( (old & mask) == 0 ) return false; // Bit is already clear? } while( !nbsi.CAS( j>>6, old, old & ~mask ) ); _size.add(-1); return true; }
/** * Remove {@code i} from the set. This is the fast lower-case '{@code int}' * version of {@link #remove} - no autoboxing. * @return <tt>true</tt> if i was added to the set. */ public boolean remove ( final int i ) { return i >= 0 && _nbsi.remove(i); }