Package htsjdk.samtools

# Class TextCigarCodec

java.lang.Object
htsjdk.samtools.TextCigarCodec

public class TextCigarCodec extends Object
Convert between String and Cigar class representations of CIGAR.

## Constructor Summary

Constructors
Constructor
Description
`TextCigarCodec()`

## Method Summary

Modifier and Type
Method
Description
`static Cigar`
`decode(String textCigar)`
Convert from String CIGAR representation to Cigar class representation.
`static String`
`encode(Cigar cigar)`
Convert from Cigar class representation to String.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TextCigarCodec

public TextCigarCodec()

## Method Details

### encode

public static String encode(Cigar cigar)
Convert from Cigar class representation to String.

Parameters:
  `cigar` - in Cigar class format
Returns:
  CIGAR in String form ala SAM text file. "*" means empty CIGAR.

### decode

public static Cigar decode(String textCigar)
Convert from String CIGAR representation to Cigar class representation. Does not do validation beyond the most basic CIGAR string well-formedness, i.e. each operator is valid, and preceded by a decimal length.

Parameters:
  `textCigar` - CIGAR in String form ala SAM text file. "*" means empty CIGAR.
Returns:
  cigar in Cigar class format
Throws:
  `RuntimeException` - if textCigar is invalid at the most basic level.