private void removeExceedingTicks ( ) { int tickCount = ticks . size ( ) ; if ( tickCount > maximumTickCount ) { // Removing old ticks int nbTicksToRemove = tickCount - maximumTickCount ; for ( int i = 0 ; i < nbTicksToRemove ; i ++ ) { ticks . remove ( 0 ) ; } // Updating removed ticks count removedTicksCount += nbTicksToRemove ; } }
Removes the N first ticks which exceed the maximum tick count .