# Class VCFCompoundHeaderLine

java.lang.Object
htsjdk.variant.vcf.VCFHeaderLine
htsjdk.variant.vcf.VCFCompoundHeaderLine

All Implemented Interfaces:
  `VCFIDHeaderLine, Serializable, Comparable`

Direct Known Subclasses:
  `VCFFormatHeaderLine, VCFInfoHeaderLine`

public abstract class VCFCompoundHeaderLine extends VCFHeaderLine implements VCFIDHeaderLine
a base class for compound header lines, which include info lines and format lines (so far)

See Also:
  - Serialized Form

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`VCFCompoundHeaderLine.SupportedHeaderLineType`

## Field Summary

### Fields inherited from class VCFHeaderLine

`ALLOW_UNBOUND_DESCRIPTIONS, serialVersionUID, UNBOUND_DESCRIPTION`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`VCFCompoundHeaderLine(String name, int count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)`
create a VCF format header line
`protected`
`VCFCompoundHeaderLine(String name, int count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType, String source, String version)`
create a VCF format header line
`protected`
`VCFCompoundHeaderLine(String name, VCFHeaderLineCount count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)`
create a VCF format header line
`protected`
`VCFCompoundHeaderLine(String name, VCFHeaderLineCount count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType, String source, String version)`
create a VCF format header line
`protected`
`VCFCompoundHeaderLine(String line, VCFHeaderVersion version, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)`
create a VCF format header line

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
returns true if we're equal to another compound header line
`boolean`
`equalsExcludingDescription(VCFCompoundHeaderLine other)`
`int`
`getCount()`
`int`
`getCount(VariantContext vc)`
Get the number of values expected for this header field, given the properties of VariantContext vc If the count is a fixed count, return that.
`VCFHeaderLineCount`
`getCountType()`
`String`
`getDescription()`
`String`
`getID()`
`String`
`getSource()`
`VCFHeaderLineType`
`getType()`
`String`
`getVersion()`
`int`
`hashCode()`
`boolean`
`isFixedCount()`
`boolean`
`sameLineTypeAndName(VCFCompoundHeaderLine other)`
`void`
`setNumberToUnbounded()`
`void`
`setSource(String source)`
Specify annotation source
`void`
`setVersion(String version)`
Specify annotation version
`protected String`
`toStringEncoding()`
make a string representation of this header line

### Methods inherited from class VCFHeaderLine

`compareTo, getKey, getValue, isHeaderLine, shouldBeAddedToDictionary, toString, toStringEncoding`

### Methods inherited from class Object

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

## Constructor Details

### VCFCompoundHeaderLine

protected VCFCompoundHeaderLine(String name, int count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)
create a VCF format header line

Parameters:
  `name` - the name for this header line
  `count` - the count for this header line
  `type` - the type for this header line
  `description` - the description for this header line
  `lineType` - the header line type

### VCFCompoundHeaderLine

protected VCFCompoundHeaderLine(String name, VCFHeaderLineCount count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)
create a VCF format header line

Parameters:
  `name` - the name for this header line
  `count` - the count type for this header line
  `type` - the type for this header line
  `description` - the description for this header line
  `lineType` - the header line type

### VCFCompoundHeaderLine

protected VCFCompoundHeaderLine(String name, int count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType, String source, String version)
create a VCF format header line

Parameters:
  `name` - the name for this header line
  `count` - the count for this header line
  `type` - the type for this header line
  `description` - the description for this header line
  `lineType` - the header line type
  `source` - annotation source (case-insensitive, e.g. "dbsnp")
  `version` - exact version (e.g. "138")

### VCFCompoundHeaderLine

protected VCFCompoundHeaderLine(String name, VCFHeaderLineCount count, VCFHeaderLineType type, String description, VCFCompoundHeaderLine.SupportedHeaderLineType lineType, String source, String version)
create a VCF format header line

Parameters:
  `name` - the name for this header line
  `count` - the count type for this header line
  `type` - the type for this header line
  `description` - the description for this header line
  `lineType` - the header line type
  `source` - annotation source (case-insensitive, e.g. "dbsnp")
  `version` - exact version (e.g. "138")

### VCFCompoundHeaderLine

protected VCFCompoundHeaderLine(String line, VCFHeaderVersion version, VCFCompoundHeaderLine.SupportedHeaderLineType lineType)
create a VCF format header line

Parameters:
  `line` - the header line
  `version` - the VCF header version
  `lineType` - the header line type

## Method Details

### getID

public String getID()

Specified by:
  `getID` in interface `VCFIDHeaderLine`

### getDescription

public String getDescription()

### getType

public VCFHeaderLineType getType()

### getCountType

public VCFHeaderLineCount getCountType()

### isFixedCount

public boolean isFixedCount()

### getCount

public int getCount()

### getSource

public String getSource()

### getVersion

public String getVersion()

### getCount

public int getCount(VariantContext vc)
Get the number of values expected for this header field, given the properties of VariantContext vc If the count is a fixed count, return that. For example, a field with size of 1 in the header returns 1 If the count is of type A, return vc.getNAlleles - 1 If the count is of type R, return vc.getNAlleles If the count is of type G, return the expected number of genotypes given the number of alleles in VC and the max ploidy among all samples. Note that if the max ploidy of the VC is 0 (there's no GT information at all, then implicitly assume diploid samples when computing G values. If the count is UNBOUNDED return -1

Parameters:
  `vc` -
Returns:

### setNumberToUnbounded

public void setNumberToUnbounded()

### toStringEncoding

protected String toStringEncoding()
make a string representation of this header line

Overrides:
  `toStringEncoding` in class `VCFHeaderLine`
Returns:
  a string representation

### equals

public boolean equals(Object o)
returns true if we're equal to another compound header line

Overrides:
  `equals` in class `VCFHeaderLine`
Parameters:
  `o` - a compound header line
Returns:
  true if equal

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `VCFHeaderLine`

### equalsExcludingDescription

public boolean equalsExcludingDescription(VCFCompoundHeaderLine other)

### sameLineTypeAndName

public boolean sameLineTypeAndName(VCFCompoundHeaderLine other)

### setSource

public void setSource(String source)
Specify annotation source

This value is optional starting with VCFv4.2.

Parameters:
  `source` - annotation source (case-insensitive, e.g. "dbsnp")

### setVersion

public void setVersion(String version)
Specify annotation version

This value is optional starting with VCFv4.2.

Parameters:
  `version` - exact version (e.g. "138")