public static List < Range < Long > > matches ( final AlignmentPair alignmentPair ) { checkNotNull ( alignmentPair ) ; List < Range < Long > > matches = new ArrayList < Range < Long > > ( ) ; int matchStart = - 1 ; for ( int i = 1 , length = alignmentPair . length ( ) + 1 ; i < length ; i ++ ) { if ( isMatchSymbol ( alignmentPair . symbolAt ( i ) ) ) { if ( matchStart < 0 ) { matchStart = i ; } } else { if ( matchStart > 0 ) { // biojava coordinates are 1-based matches . add ( Range . closedOpen ( Long . valueOf ( matchStart - 1L ) , Long . valueOf ( i - 1L ) ) ) ; matchStart = - 1 ; } } } if ( matchStart > 0 ) { matches . add ( Range . closedOpen ( Long . valueOf ( matchStart - 1L ) , Long . valueOf ( alignmentPair . length ( ) ) ) ) ; } return matches ; }
Return the alignment matches in the specified alignment pair as 0 - based [ closed open ) ranges .