org.dicom4j.data.elements
Class UnsignedShort

java.lang.Object
  extended by org.dicom4j.data.elements.support.DataElement
      extended by org.dicom4j.data.elements.UnsignedShort

public class UnsignedShort
extends DataElement

Unsigned Short (US) Attribute

Since:
0.0.0
Author:
Laurent Lecomte

Constructor Summary
UnsignedShort(DicomTag aDataElementTag)
          creates new Element
UnsignedShort(DicomTag t, int aUnsigned16)
           
 
Method Summary
 void addValue(int aUnsigned16)
          add a new Value to this element
 int getIntegerValue(int aIndex)
           
 int[] getIntegerValues()
           Get the values of this attribute as an int array.
 long getPaddedVL()
           Get the value length of this attribute, accounting for the need for even-length padding.
 String[] getStringValues(NumberFormat format)
           Get the values of this attribute as strings.
 int getValueMultiplicity()
           Get the value multiplicity of this element
 ValueRepresentation getValueRepresentation()
          get the value representation of this data element
 int[] getValues()
           
 byte[] getVR()
           Get the value representation of this attribute (US).
 void read(DicomInputStream aStream, long aLength, SpecificCharacterSet aCharacterSet)
           
 void setValue(int aUnsigned16)
           
 String toString()
           Dump the contents of the attribute as a human-readable string.
 void write(DicomOutputStream o)
           Write the entire attribute (including values) to the output stream.
 
Methods inherited from class org.dicom4j.data.elements.support.DataElement
addValue, addValue, addValue, addValue, addValue, addValue, clear, getByteValues, getDelimitedStringValues, getDelimitedStringValues, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDoubleValues, getDoubleValues, getFloatValues, getIntegerValues, getLongValues, getLongValues, getName, getOriginalStringValues, getShortValues, getSingleDoubleValueOrDefault, getSingleDoubleValueOrDefault, getSingleIntegerValue, getSingleIntegerValue, getSingleIntegerValue, getSingleIntegerValueOrDefault, getSingleLongValueOrDefault, getSingleLongValueOrDefault, getSingleStringValue, getSingleStringValue, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getStringValues, getStringValues, getStringValues, getTag, getValueLength, isAvailableAsString, isGroupLength, isValid, read, removeValues, setValues, setValues, setValues
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UnsignedShort

public UnsignedShort(DicomTag aDataElementTag)
creates new Element

Parameters:
aDataElementTag - the tag

UnsignedShort

public UnsignedShort(DicomTag t,
                     int aUnsigned16)
              throws DicomException
Throws:
DicomException
Method Detail

addValue

public void addValue(int aUnsigned16)
              throws DicomException
add a new Value to this element

Overrides:
addValue in class DataElement
Parameters:
aUnsigned16 - the value
Throws:
DicomException

getIntegerValue

public int getIntegerValue(int aIndex)

getIntegerValues

public int[] getIntegerValues()
                       throws DicomException
Description copied from class: DataElement

Get the values of this attribute as an int array.

Overrides:
getIntegerValues in class DataElement
Returns:
the values as an array of int
Throws:
DicomException - thrown if values are not available (such as not supported for this concrete attribute class)

getPaddedVL

public long getPaddedVL()
Description copied from class: DataElement

Get the value length of this attribute, accounting for the need for even-length padding.

Overrides:
getPaddedVL in class DataElement
Returns:
the value length (padded to an even length)

getStringValues

public String[] getStringValues(NumberFormat format)
                         throws DicomException
Description copied from class: DataElement

Get the values of this attribute as strings.

The strings may have been cleaned up into a canonical form, such as to remove padding as well as numbers formatted.

Overrides:
getStringValues in class DataElement
Parameters:
format - the format to use for each numerical or decimal value
Returns:
the values as an array of String
Throws:
DicomException - thrown if values are not available (such as not supported for this concrete attribute class)

getValueMultiplicity

public int getValueMultiplicity()
Description copied from class: DataElement

Get the value multiplicity of this element

Overrides:
getValueMultiplicity in class DataElement
Returns:
the value multiplicity

getValueRepresentation

public ValueRepresentation getValueRepresentation()
get the value representation of this data element

Specified by:
getValueRepresentation in class DataElement
Returns:
the value representation (UL)

getValues

public int[] getValues()

getVR

public byte[] getVR()

Get the value representation of this attribute (US).

Returns:
'U','S' in ASCII as a two byte array; see

read

public void read(DicomInputStream aStream,
                 long aLength,
                 SpecificCharacterSet aCharacterSet)
          throws IOException,
                 DicomException
Specified by:
read in class DataElement
Throws:
IOException
DicomException

setValue

public void setValue(int aUnsigned16)
              throws DicomException
Throws:
DicomException

toString

public String toString()
Description copied from class: DataElement

Dump the contents of the attribute as a human-readable string.

No new line is appended.

The result is of the form:

 (0xgggg,0xeeee) VR=<XX> VL=<0xnnnn> <...>
 

For example:

 (0x0018,0x0020) VR=<CS> VL=<0x2> <GR>
 

Overrides:
toString in class DataElement
Returns:
a single String value

write

public void write(DicomOutputStream o)
           throws DicomException,
                  IOException
Description copied from class: DataElement

Write the entire attribute (including values) to the output stream.

Specified by:
write in class DataElement
Parameters:
o - the output stream
Throws:
DicomException
IOException


Copyright © 2009 dicom4j. All Rights Reserved.