public static List < Range < Long > > gaps ( final GappedSymbolList gappedSymbols ) { checkNotNull ( gappedSymbols ) ; List < Range < Long > > gaps = new ArrayList < Range < Long > > ( ) ; int gapStart = - 1 ; for ( int i = 1 , length = gappedSymbols . length ( ) + 1 ; i < length ; i ++ ) { if ( isGapSymbol ( gappedSymbols . symbolAt ( i ) ) ) { if ( gapStart < 0 ) { gapStart = i ; } } else { if ( gapStart > 0 ) { // biojava coordinates are 1-based gaps . add ( Range . closedOpen ( Long . valueOf ( gapStart - 1L ) , Long . valueOf ( i - 1L ) ) ) ; gapStart = - 1 ; } } } if ( gapStart > 0 ) { gaps . add ( Range . closedOpen ( Long . valueOf ( gapStart - 1L ) , Long . valueOf ( gappedSymbols . length ( ) ) ) ) ; } return gaps ; }
Return the gaps in the specified gapped symbol list as 0 - based [ closed open ) ranges .