Package htsjdk.samtools
Class AbstractSAMHeaderRecord
java.lang.Object
htsjdk.samtools.AbstractSAMHeaderRecord
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SAMFileHeader
,SAMProgramRecord
,SAMReadGroupRecord
,SAMSequenceRecord
Base class for the various concrete records in a SAM header, providing uniform
access to the attributes.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
For use in the equals() method of the concrete class.protected int
For use in the hashCode() method of the concrete class.getAttribute
(String key) Returns the Set of attributes.getId()
Returns the ID tag (or equivalent) for this header record.abstract String
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.void
setAttribute
(String key, String value) Set the given value for the attribute named 'key'.toString()
Simple to String that outputs the concrete class name and the set of attributes stored.
-
Field Details
-
serialVersionUID
public static final long serialVersionUID- See Also:
-
-
Constructor Details
-
AbstractSAMHeaderRecord
public AbstractSAMHeaderRecord()
-
-
Method Details
-
getAttribute
-
setAttribute
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
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
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
-
getAttributes
Returns the Set of attributes. -
getId
Returns the ID tag (or equivalent) for this header record. The default implementation throws a SAMException to indicate "not implemented". -
attributesEqual
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
Simple to String that outputs the concrete class name and the set of attributes stored. -
getSAMString
Returns the record in the SAM line-based text format. Fields are separated by '\t' characters. The String is NOT terminated by '\n'.
-
instead