Updating AlignmentUtils.consolidateCigar() to the GATK coding standards.

This commit is contained in:
Ryan Poplin 2013-01-31 15:57:48 -05:00
parent b4db1d3e7f
commit e07cefb058
1 changed files with 3 additions and 2 deletions

View File

@ -508,12 +508,13 @@ public class AlignmentUtils {
* For example, 1M1M1M1D2M1M --> 3M1D3M
* If the given cigar is empty then the returned cigar will also be empty
* @param c the cigar to consolidate
* @return a cigar with consecutive matching operators merged into single operators.
* @return a non-null cigar with consecutive matching operators merged into single operators.
*/
@Requires({"c != null"})
@Ensures({"result != null"})
public static Cigar consolidateCigar( final Cigar c ) {
if( c == null ) { throw new IllegalArgumentException("Cigar cannot be null"); }
if( c.isEmpty() ) { return c; }
final Cigar returnCigar = new Cigar();
int sumLength = 0;
for( int iii = 0; iii < c.numCigarElements(); iii++ ) {