public long getEarliestEventTs ( long startTs , long endTs ) { long minTs = Long . MAX_VALUE ; for ( Event < T > event : queue ) { if ( event . getTimestamp ( ) > startTs && event . getTimestamp ( ) <= endTs ) { minTs = Math . min ( minTs , event . getTimestamp ( ) ) ; } } return minTs ; }
Scans the event queue and returns the next earliest event ts between the startTs and endTs