Package htsjdk.samtools
Class AbstractSAMHeaderRecord
- java.lang.Object
-
- htsjdk.samtools.AbstractSAMHeaderRecord
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SAMFileHeader
,SAMProgramRecord
,SAMReadGroupRecord
,SAMSequenceRecord
public abstract class AbstractSAMHeaderRecord extends Object implements Serializable
Base class for the various concrete records in a SAM header, providing uniform access to the attributes.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description AbstractSAMHeaderRecord()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
attributesEqual(AbstractSAMHeaderRecord that)
For use in the equals() method of the concrete class.protected int
attributesHashCode()
For use in the hashCode() method of the concrete class.String
getAttribute(String key)
Set<Map.Entry<String,String>>
getAttributes()
Returns the Set of attributes.String
getId()
Returns the ID tag (or equivalent) for this header record.abstract String
getSAMString()
Returns the record in the SAM line-based text format.void
setAttribute(SAMTag tag, String value)
Set the given value for the SAMTag 'tag'.void
setAttribute(String key, Object value)
Deprecated.Useinstead
void
setAttribute(String key, String value)
Set the given value for the attribute named 'key'.String
toString()
Simple to String that outputs the concrete class name and the set of attributes stored.
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
setAttribute
@Deprecated public void setAttribute(String key, Object value)
Deprecated.Useinstead
Set the given value for the attribute named 'key'. Replaces an existing value, if any. If value is null, the attribute is removed. Otherwise, the value will be converted to a String with toString.- Parameters:
key
- attribute namevalue
- attribute value
-
setAttribute
public void setAttribute(SAMTag tag, String value)
Set the given value for the SAMTag 'tag'. Replaces an existing value, if any. If value is null, the attribute is removed.- Parameters:
tag
- attribute namevalue
- attribute value
-
setAttribute
public void setAttribute(String key, String value)
Set the given value for the attribute named 'key'. Replaces an existing value, if any. If value is null, the attribute is removed.- Parameters:
key
- attribute namevalue
- attribute value
-
getId
public String getId()
Returns the ID tag (or equivalent) for this header record. The default implementation throws a SAMException to indicate "not implemented".
-
attributesEqual
protected boolean attributesEqual(AbstractSAMHeaderRecord that)
For use in the equals() method of the concrete class.
-
attributesHashCode
protected int attributesHashCode()
For use in the hashCode() method of the concrete class.
-
toString
public String toString()
Simple to String that outputs the concrete class name and the set of attributes stored.
-
getSAMString
public abstract String getSAMString()
Returns the record in the SAM line-based text format. Fields are separated by '\t' characters. The String is NOT terminated by '\n'.
-
-