private void seekNext ( ) { if ( ! needSeek ) { return ; } // First, iterate all if ( this . currentIterator != null && this . currentIterator . hasNext ( ) ) { needSeek = false ; return ; } // Then, find the next available work unit nextWu = null ; this . currentIterator = null ; while ( nextWu == null && workUnits . hasNext ( ) ) { nextWu = workUnits . next ( ) ; if ( nextWu instanceof MultiWorkUnit ) { this . currentIterator = ( ( MultiWorkUnit ) nextWu ) . getWorkUnits ( ) . iterator ( ) ; if ( ! this . currentIterator . hasNext ( ) ) { nextWu = null ; } } } needSeek = false ; }
Seek to the next available work unit skipping all empty work units