private void clearEvents ( long index ) { if ( index > completeIndex ) { EventHolder event = events . peek ( ) ; while ( event != null && event . eventIndex <= index ) { events . remove ( ) ; completeIndex = event . eventIndex ; event = events . peek ( ) ; } completeIndex = index ; } }
Clears events up to the given sequence .