public String encode(final Cigar cigar){
  if (cigar.isEmpty()) {
    return "*";
  }
  final StringBuilder ret=new StringBuilder();
  for (  final CigarElement cigarElement : cigar.getCigarElements()) {
    ret.append(cigarElement.getLength());
    ret.append(cigarElement.getOperator());
  }
  return ret.toString();
}

public String encode ( final Cigar cigar ) { if ( cigar . isEmpty ( ) ) { return "*" ; } final StringBuilder ret = new StringBuilder ( ) ; for ( final CigarElement cigarElement : cigar . getCigarElements ( ) ) { ret . append ( cigarElement . getLength ( ) ) ; ret . append ( cigarElement . getOperator ( ) ) ; } return ret . toString ( ) ; }
convert from cigar class representation to string .
