org.dicom4j.data.elements
Class SequenceOfItems

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

public class SequenceOfItems
extends DataElement

Sequence (SQ) Attribute

Since:
Alpha 0.0.0
Author:
Laurent Lecomte

Constructor Summary
SequenceOfItems(DicomTag aDataElementTag)
           Creates a new DataElement
 
Method Summary
 void addItem(DataSet aItem)
          Add an item to the sequence (after any existing items).
 void addItem(DataSet aItem, long byteOffset)
           
 void clear()
          Clear Data contains in this Element
 int count()
          get the number of items in the sequence.
 SequenceItems getItem(int index)
          Get an SequenceItem by his index in the sequence.
static String getMeaningOfCodedSequenceAttributeOrDefault(DataSet list, DicomTag tag, String dflt)
           
static DataElement getNamedAttributeFromWithinSequenceWithSingleItem(DataSet list, DicomTag sequenceTag, DicomTag namedTag)
           From within a list of attributes, get the specified sequence which has one item, and from within that extract the specified attribute.
static DataElement getNamedAttributeFromWithinSequenceWithSingleItem(SequenceOfItems sequenceAttribute, DicomTag namedTag)
           From the specified sequence which has one item, and from within that extract the specified attribute.
 ValueRepresentation getValueRepresentation()
          Return the value representation of this data element
 byte[] getVR()
          Deprecated.  
 int itemsCount()
          Deprecated.  
 Iterator<SequenceItems> iterator()
          Get an Iterator of the items in the sequence.
 void read(DicomInputStream aStream, long aLength, SpecificCharacterSet aCharacterSet)
           
 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, addValue, getByteValues, getDelimitedStringValues, getDelimitedStringValues, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrDefault, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrEmptyString, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDelimitedStringValuesOrNull, getDoubleValues, getDoubleValues, getFloatValues, getIntegerValues, getIntegerValues, getLongValues, getLongValues, getName, getOriginalStringValues, getPaddedVL, getShortValues, getSingleDoubleValueOrDefault, getSingleDoubleValueOrDefault, getSingleIntegerValue, getSingleIntegerValue, getSingleIntegerValue, getSingleIntegerValueOrDefault, getSingleLongValueOrDefault, getSingleLongValueOrDefault, getSingleStringValue, getSingleStringValue, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrDefault, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrEmptyString, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getSingleStringValueOrNull, getStringValues, getStringValues, getStringValues, getStringValues, getTag, getValueLength, getValueMultiplicity, 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

SequenceOfItems

public SequenceOfItems(DicomTag aDataElementTag)

Creates a new DataElement

Parameters:
aDataElementTag - the tag of the element
Method Detail

getMeaningOfCodedSequenceAttributeOrDefault

public static String getMeaningOfCodedSequenceAttributeOrDefault(DataSet list,
                                                                 DicomTag tag,
                                                                 String dflt)
Parameters:
list -
tag -
dflt -

getNamedAttributeFromWithinSequenceWithSingleItem

public static DataElement getNamedAttributeFromWithinSequenceWithSingleItem(DataSet list,
                                                                            DicomTag sequenceTag,
                                                                            DicomTag namedTag)

From within a list of attributes, get the specified sequence which has one item, and from within that extract the specified attribute.

Parameters:
list - the list that contains the sequence (may not be null)
sequenceTag - the tag of the sequence attribute that has one item
namedTag - the tag of the attribute within the item of the sequence
Returns:
the attribute if found else null

getNamedAttributeFromWithinSequenceWithSingleItem

public static DataElement getNamedAttributeFromWithinSequenceWithSingleItem(SequenceOfItems sequenceAttribute,
                                                                            DicomTag namedTag)

From the specified sequence which has one item, and from within that extract the specified attribute.

Parameters:
sequenceAttribute - the sequence attribute that has one item (may be null in which case returns null)
namedTag - the tag of the attribute within the item of the sequence
Returns:
the attribute if found else null

addItem

public void addItem(DataSet aItem)
Add an item to the sequence (after any existing items).

Parameters:
item - the list of attributes that comprise the item

addItem

public void addItem(DataSet aItem,
                    long byteOffset)
Parameters:
aItem -
byteOffset -

clear

public void clear()
Description copied from class: DataElement
Clear Data contains in this Element

Overrides:
clear in class DataElement

count

public int count()
get the number of items in the sequence.

Returns:
the number of items

getItem

public SequenceItems getItem(int index)
Get an SequenceItem by his index in the sequence.

Parameters:
index - which item to return, numbered from zero
Returns:
the item or null if no items or no such item

getValueRepresentation

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

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

getVR

@Deprecated
public byte[] getVR()
Deprecated. 

Get the value representation of this attribute (SQ).

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

itemsCount

@Deprecated
public int itemsCount()
Deprecated. 

Returns:

iterator

public Iterator<SequenceItems> iterator()
Get an Iterator of the items in the sequence.

Returns:
a Iterator of items, each encoded as an SequenceItem

read

public void read(DicomInputStream aStream,
                 long aLength,
                 SpecificCharacterSet aCharacterSet)
          throws IOException,
                 DicomException
Specified by:
read in class DataElement
Throws:
IOException
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 -
Throws:
IOException
DicomException


Copyright © 2009 dicom4j. All Rights Reserved.