Class SequenceItem


  • public class SequenceItem
    extends java.lang.Object

    A class to provide support for the contents of an individual item of a DICOM Sequence (SQ) attribute, each of which consists of an entire dataset (list of attributes).

    See Also:
    SequenceAttribute
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long byteOffset  
    • Constructor Summary

      Constructors 
      Constructor Description
      SequenceItem​(AttributeList l)
      Construct a sequence attribute item with a list of attributes.
      SequenceItem​(AttributeList l, long offset)
      Construct a sequence attribute item with a list of attributes, additionally keeping track of where in the byte stream that the attributes were read from the item starts, for use in supporting DICOM Directory Records which are indexed by physical byte offset (see DicomDirectory).
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AttributeList getAttributeList()
      Get the list of attributes in this item.
      long getByteOffset()
      Get the byte offset of the start of this item recorded when the item was read.
      java.lang.String getDelimitedStringValuesOrDefault​(java.lang.String dflt, java.text.NumberFormat format, java.lang.String delimiter)
      Get all the string values for the item, separated by the specified delimiter.
      void setByteOffset​(long byteOffset)
      Set the byte offset of the start of this item.
      java.lang.String toString()
      Dump the item in a human readable form, list the contained attributes.
      java.lang.String toString​(DicomDictionary dictionary)
      Dump the item in a human readable form, list the contained attributes.
      void write​(DicomOutputStream o)
      Write the item (with appropriate delimiter tags) to the output stream.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • byteOffset

        protected long byteOffset
    • Constructor Detail

      • SequenceItem

        public SequenceItem​(AttributeList l)

        Construct a sequence attribute item with a list of attributes.

        Parameters:
        l - the list of attributes that comprise the item
      • SequenceItem

        public SequenceItem​(AttributeList l,
                            long offset)

        Construct a sequence attribute item with a list of attributes, additionally keeping track of where in the byte stream that the attributes were read from the item starts, for use in supporting DICOM Directory Records which are indexed by physical byte offset (see DicomDirectory).

        Parameters:
        l - the list of attributes that comprise the item
        offset -
    • Method Detail

      • getAttributeList

        public AttributeList getAttributeList()

        Get the list of attributes in this item.

        Returns:
        the attribute list
      • setByteOffset

        public void setByteOffset​(long byteOffset)

        Set the byte offset of the start of this item.

        Primary use is to set it to zero when no longer needed or correct.

        Parameters:
        byteOffset - the byte offset, or zero if to be cleared
      • getByteOffset

        public long getByteOffset()

        Get the byte offset of the start of this item recorded when the item was read.

        Returns:
        the byte offset
      • write

        public void write​(DicomOutputStream o)
                   throws DicomException,
                          java.io.IOException

        Write the item (with appropriate delimiter tags) to the output stream.

        Always written in undefined length form.

        Parameters:
        o - the output stream
        Throws:
        java.io.IOException
        DicomException
      • toString

        public java.lang.String toString​(DicomDictionary dictionary)

        Dump the item in a human readable form, list the contained attributes.

        Parameters:
        dictionary -
        Returns:
        the string representing the content of the item
      • toString

        public java.lang.String toString()

        Dump the item in a human readable form, list the contained attributes.

        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representing the content of the item
      • getDelimitedStringValuesOrDefault

        public java.lang.String getDelimitedStringValuesOrDefault​(java.lang.String dflt,
                                                                  java.text.NumberFormat format,
                                                                  java.lang.String delimiter)

        Get all the string values for the item, separated by the specified delimiter.

        If there is no string value for an individual value or an exception trying to fetch it, the supplied default is returned for each Attribute.

        A canonicalized (unpadded) form is returned for each Attribute value, not the original string.

        Parameters:
        dflt - what to return if there are no (valid) string values
        format - the format to use for each numerical or decimal value (null if none)
        delimiter - the delimiter to use between each value
        Returns:
        the values as a delimited String