Package htsjdk.samtools
Class SAMBinaryTagAndValue
- java.lang.Object
-
- htsjdk.samtools.SAMBinaryTagAndValue
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
SAMBinaryTagAndUnsignedArrayValue
public class SAMBinaryTagAndValue extends Object implements Serializable
Holds a SAMRecord attribute and the tagname (in binary form) for that attribute. SAMRecord stores tag name and value in this form, because much String creation is avoided this way. See SAMTagUtil to convert the tag to String form. Values associated with attribute tags must be of a type that implementsSerializable
or else serialization will fail. Accepted types are String, scalar types Short, Integer, Character, Float, and Long (see below); array types byte[], short[], int[] and float[]. Cannot be null. Long valued attributes are constrained to the range [Integer.MIN_VALUE, BinaryCodec.MAX_UINT], which includes the entire range of signed ints [Integer.MIN_VALUE, Integer.MAX_VALUE] and the entire range of unsigned ints that can be stored per the BAM spec [0, (Integer.MAX_VALUE * 2) + 1].- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected SAMBinaryTagAndValue
next
static long
serialVersionUID
short
tag
Object
value
-
Constructor Summary
Constructors Constructor Description SAMBinaryTagAndValue(short tag, Object value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
cloneValue()
SAMBinaryTagAndValue
copy()
Creates and returns a shallow copy of the list of tag/values.SAMBinaryTagAndValue
deepCopy()
Creates and returns a deep copy of the list of tag/values.boolean
equals(Object o)
SAMBinaryTagAndValue
find(short tag)
Returns the SAMBinaryTagAndValue that contains the required tag, or null if not contained.SAMBinaryTagAndValue
getNext()
int
hashCode()
SAMBinaryTagAndValue
insert(SAMBinaryTagAndValue attr)
Inserts an item into the ordered list of attributes and returns the head of the list/sub-listprotected static boolean
isAllowedAttributeValue(Object value)
boolean
isUnsignedArray()
SAMBinaryTagAndValue
remove(short tag)
Removes a tag from the list and returns the new head of the list/sub-list.
-
-
-
Field Detail
-
serialVersionUID
public static final long serialVersionUID
- See Also:
- Constant Field Values
-
tag
public final short tag
-
value
public final Object value
-
next
protected SAMBinaryTagAndValue next
-
-
Constructor Detail
-
SAMBinaryTagAndValue
public SAMBinaryTagAndValue(short tag, Object value)
- Parameters:
tag
- tagname (in binary form) for this attributevalue
- value for this attribute (must be of a type that implementsSerializable
or else serialization will fail). Cannot be null.
-
-
Method Detail
-
isAllowedAttributeValue
protected static boolean isAllowedAttributeValue(Object value)
-
copy
public SAMBinaryTagAndValue copy()
Creates and returns a shallow copy of the list of tag/values.
-
deepCopy
public SAMBinaryTagAndValue deepCopy()
Creates and returns a deep copy of the list of tag/values.
-
cloneValue
protected Object cloneValue()
-
getNext
public SAMBinaryTagAndValue getNext()
-
insert
public SAMBinaryTagAndValue insert(SAMBinaryTagAndValue attr)
Inserts an item into the ordered list of attributes and returns the head of the list/sub-list
-
remove
public SAMBinaryTagAndValue remove(short tag)
Removes a tag from the list and returns the new head of the list/sub-list.
-
find
public SAMBinaryTagAndValue find(short tag)
Returns the SAMBinaryTagAndValue that contains the required tag, or null if not contained.
-
isUnsignedArray
public boolean isUnsignedArray()
-
-