# Class SAMProgramRecord

java.lang.Object
htsjdk.samtools.AbstractSAMHeaderRecord
htsjdk.samtools.SAMProgramRecord

All Implemented Interfaces:
  `Serializable`

public class SAMProgramRecord extends AbstractSAMHeaderRecord
In-memory representation of @PG SAM header record.

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`COMMAND_LINE_TAG`
`static final String`
`PREVIOUS_PROGRAM_GROUP_ID_TAG`
`static final String`
`PROGRAM_GROUP_ID_TAG`
`static final String`
`PROGRAM_NAME_TAG`
`static final String`
`PROGRAM_VERSION_TAG`
`static final Set<String>`
`STANDARD_TAGS`

### Fields inherited from class AbstractSAMHeaderRecord

`serialVersionUID`

## Constructor Summary

Constructors
Constructor
Description
`SAMProgramRecord(String programGroupId)`
`SAMProgramRecord(String id, SAMProgramRecord srcProgramRecord)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`boolean`
`equivalent(SAMProgramRecord that)`
`String`
`getCommandLine()`
`String`
`getId()`
Returns the ID tag (or equivalent) for this header record.
`String`
`getPreviousProgramGroupId()`
`String`
`getProgramGroupId()`
`String`
`getProgramName()`
`String`
`getProgramVersion()`
`String`
`getSAMString()`
Returns the record in the SAM line-based text format.
`int`
`hashCode()`
`void`
`setCommandLine(String commandLine)`
`void`
`setPreviousProgramGroupId(String id)`
`void`
`setProgramName(String name)`
`void`
`setProgramVersion(String version)`

### Methods inherited from class AbstractSAMHeaderRecord

`attributesEqual, attributesHashCode, getAttribute, getAttributes, setAttribute, setAttribute, setAttribute, toString`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### PROGRAM_GROUP_ID_TAG

public static final String PROGRAM_GROUP_ID_TAG

See Also:
  - Constant Field Values

### PROGRAM_NAME_TAG

public static final String PROGRAM_NAME_TAG

See Also:
  - Constant Field Values

### PROGRAM_VERSION_TAG

public static final String PROGRAM_VERSION_TAG

See Also:
  - Constant Field Values

### COMMAND_LINE_TAG

public static final String COMMAND_LINE_TAG

See Also:
  - Constant Field Values

### PREVIOUS_PROGRAM_GROUP_ID_TAG

public static final String PREVIOUS_PROGRAM_GROUP_ID_TAG

See Also:
  - Constant Field Values

### STANDARD_TAGS

public static final Set<String> STANDARD_TAGS

## Constructor Details

### SAMProgramRecord

public SAMProgramRecord(String programGroupId)

### SAMProgramRecord

public SAMProgramRecord(String id, SAMProgramRecord srcProgramRecord)

## Method Details

### getId

public String getId()
Description copied from class: `AbstractSAMHeaderRecord`
Returns the ID tag (or equivalent) for this header record. The default implementation throws a SAMException to indicate "not implemented".

Overrides:
  `getId` in class `AbstractSAMHeaderRecord`

### getProgramGroupId

public String getProgramGroupId()

### getProgramName

public String getProgramName()

### setProgramName

public void setProgramName(String name)

### getProgramVersion

public String getProgramVersion()

### setProgramVersion

public void setProgramVersion(String version)

### getCommandLine

public String getCommandLine()

### setCommandLine

public void setCommandLine(String commandLine)

### getPreviousProgramGroupId

public String getPreviousProgramGroupId()

### setPreviousProgramGroupId

public void setPreviousProgramGroupId(String id)

### equivalent

public boolean equivalent(SAMProgramRecord that)

Returns:
  true if this == that except for the program group ID, which is arbitrary

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### getSAMString

public String getSAMString()
Description copied from class: `AbstractSAMHeaderRecord`
Returns the record in the SAM line-based text format. Fields are separated by '\t' characters. The String is NOT terminated by '\n'.

Specified by:
  `getSAMString` in class `AbstractSAMHeaderRecord`