question: void removeAt ( final int removeIndex ) { final Object [ ] items = this . items ; if ( removeIndex == takeIndex ) { items [ takeIndex ] = null ; if ( ++ takeIndex == items . length ) takeIndex = 0 ; count -- ; if ( itrs != null ) itrs . elementDequeued ( ) ; } else { final int putIndex = this . putIndex ; for ( int i = removeIndex ; ; ) { int next = i + 1 ; if ( next == items . length ) next = 0 ; if ( next != putIndex ) { items [ i ] = items [ next ] ; i = next ; } else { items [ i ] = null ; this . putIndex = i ; break ; } } count -- ; if ( itrs != null ) itrs . removedAt ( removeIndex ) ; } notFull . signal ( ) ; }
target:  Deletes item at array index removeIndex. Utility for remove(Object) and iterator.remove. Call only when holding lock.