Class DecimalStringAttribute

    • Field Detail

      • MAX_LENGTH_SINGLE_VALUE

        protected static final int MAX_LENGTH_SINGLE_VALUE
        See Also:
        Constant Field Values
    • Constructor Detail

      • DecimalStringAttribute

        public DecimalStringAttribute​(AttributeTag t)

        Construct an (empty) attribute.

        Parameters:
        t - the tag of the attribute
      • DecimalStringAttribute

        public DecimalStringAttribute​(AttributeTag t,
                                      long vl,
                                      DicomInputStream i)
                               throws java.io.IOException,
                                      DicomException

        Read an attribute from an input stream.

        Parameters:
        t - the tag of the attribute
        vl - the value length of the attribute
        i - the input stream
        Throws:
        java.io.IOException - if an I/O error occurs
        DicomException - if error in DICOM encoding
      • DecimalStringAttribute

        public DecimalStringAttribute​(AttributeTag t,
                                      java.lang.Long vl,
                                      DicomInputStream i)
                               throws java.io.IOException,
                                      DicomException

        Read an attribute from an input stream.

        Parameters:
        t - the tag of the attribute
        vl - the value length of the attribute
        i - the input stream
        Throws:
        java.io.IOException - if an I/O error occurs
        DicomException - if error in DICOM encoding
    • Method Detail

      • getVR

        public byte[] getVR()

        Get the value representation of this attribute (DS).

        Overrides:
        getVR in class Attribute
        Returns:
        'D','S' in ASCII as a two byte array; see ValueRepresentation
      • getStringValues

        public java.lang.String[] getStringValues​(java.text.NumberFormat format)
                                           throws DicomException
        Description copied from class: StringAttribute

        Get the values of this attribute as strings.

        The strings are first cleaned up into a canonical form, to remove leading and trailing padding.

        Overrides:
        getStringValues in class StringAttribute
        Parameters:
        format - the format to use for each numerical or decimal value
        Returns:
        the values as an array of String
        Throws:
        DicomException - if error in DICOM encoding
      • repairValues

        public boolean repairValues()
                             throws DicomException
        Description copied from class: Attribute
        Repair any existing values of this attribute to make them comply with standard VR requirements. E.g., truncate them if they are too long. N.B., Not all types of attribute support repair.
        Overrides:
        repairValues in class StringAttribute
        Returns:
        true if successfully repaired or was already valid
        Throws:
        DicomException - if error in DICOM value extraction