public void expire ( long time ) { long calculatedSize = 0 ; Iterator < Bar > it = bars . iterator ( ) ; while ( it . hasNext ( ) ) { long barSize = it . next ( ) . expire ( time ) ; if ( barSize == 0 ) { it . remove ( ) ; } calculatedSize += barSize ; } this . size = calculatedSize ; if ( bars . isEmpty ( ) ) { bars . add ( new Bar ( barEpsilon , window ) ) ; } }
Expire old events from all buckets .