Class 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 implements Serializable 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
    • Constructor Detail

      • SAMBinaryTagAndValue

        public SAMBinaryTagAndValue​(short tag,
                                    Object value)
        Parameters:
        tag - tagname (in binary form) for this attribute
        value - value for this attribute (must be of a type that implements Serializable or else serialization will fail). Cannot be null.
    • Method Detail

      • isAllowedAttributeValue

        protected static boolean isAllowedAttributeValue​(Object value)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • 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()
      • 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()