Trispark JDT
2.50.13

com.archimed.dicom
Class TagReadEvent

java.lang.Object
  extended by java.util.EventObject
      extended by com.archimed.dicom.TagReadEvent
All Implemented Interfaces:
java.io.Serializable

public class TagReadEvent
extends java.util.EventObject

TagReadEvent is used to notify interested parties that a tag is being read. After reading the header, a TagReadListener can control how the data portion is further processed with the dataReadStatus property.

Since:
1.6
See Also:
Serialized Form

Field Summary
static int NEXT_TAG
          the next tag is read.
static int READ_TAG_DATA
          the data portion of the tag is read normally (default)
static int SKIP_TAG
          the data portion of the tag is skipped and the tag is not added to the dicom object
static int SKIP_TAG_DATA
          he data portion of the thag is skipped and an empty tag is added to the DicomObject
 
Fields inherited from class java.util.EventObject
source
 
Method Summary
 DataElement getDataElement()
          returns the Data Element that is currently being read
 int getDataReadStatus()
          returns the read status.
 DicomObject getDicomObject()
          returns the DicomObject of the data element currently being read and causing this event.
 int getElement()
          returns the element value of the tag read.
 int getGroup()
          returns the group value of the tag read.
 java.io.InputStream getInputStream()
          returns an inputstream positioned at the beginning of the data portion of the tag
 int getLength()
          returns the length of the data portion of the tag being read.
 long getOffset()
          returns the offset of the beginning the data element - before the first byte of the 2 bytes of the group field - starting from the beginning of the stream.
 int getTag()
          returns the DDict constant corresponding to the group,element pair of this data element.
 int getVRType()
          returns the vr type of the tag read.
 boolean isStopReading()
          returns if reading of the stream should be stopped.
 void setDataReadStatus(int dataReadStatus)
          sets the read status.
 void setStopReading(boolean stopReading)
          sets whether the DicomReader should stop reading data elements after processing the current data element.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

READ_TAG_DATA

public static final int READ_TAG_DATA
the data portion of the tag is read normally (default)

See Also:
Constant Field Values

SKIP_TAG_DATA

public static final int SKIP_TAG_DATA
he data portion of the thag is skipped and an empty tag is added to the DicomObject

See Also:
Constant Field Values

SKIP_TAG

public static final int SKIP_TAG
the data portion of the tag is skipped and the tag is not added to the dicom object

See Also:
Constant Field Values

NEXT_TAG

public static final int NEXT_TAG
the next tag is read. The DicomReader assumes that ne of the listeners will read the data portion of the tag in the event handler code so that the inputstream is positioned at the start of the next tag.

See Also:
Constant Field Values
Method Detail

getDicomObject

public DicomObject getDicomObject()
returns the DicomObject of the data element currently being read and causing this event.


getGroup

public int getGroup()
returns the group value of the tag read.

Returns:

getElement

public int getElement()
returns the element value of the tag read.

Returns:

getTag

public int getTag()
returns the DDict constant corresponding to the group,element pair of this data element.

Returns:
int

getVRType

public int getVRType()
returns the vr type of the tag read.

Returns:

getLength

public int getLength()
returns the length of the data portion of the tag being read. This is the value specified in the tag header. If the length is undefined (= 0xFFFFFFFF) the returned value is -1.

Returns:

getInputStream

public java.io.InputStream getInputStream()
returns an inputstream positioned at the beginning of the data portion of the tag

Returns:

getDataElement

public DataElement getDataElement()
returns the Data Element that is currently being read


getDataReadStatus

public int getDataReadStatus()
returns the read status.

Returns:

setDataReadStatus

public void setDataReadStatus(int dataReadStatus)
sets the read status. The read status determines what will happen after the afterHeader call of every TagReadListener is called.

Parameters:
dataReadStatus - one of
  • READ_TAG_DATA the data portion is read normally (default)
  • SKIP_TAG_DATA the data portion is skipped and an empty tag is added to the DicomObject
  • SKIP_TAG the data portion is skipped and the tag is not added to the dicom object
  • NEXT_TAG the next tag is read. One of the listeners is responsible for reading the data portion of the tag so that the inputstream is positioned at the start of the next tag.

isStopReading

public boolean isStopReading()
returns if reading of the stream should be stopped. Default this flag is false and the DicomReader reads all tags until the end of the stream is reached

Returns:
boolean

setStopReading

public void setStopReading(boolean stopReading)
sets whether the DicomReader should stop reading data elements after processing the current data element. Default this flag is set to false.

Parameters:
stopReading - boolean

getOffset

public long getOffset()
returns the offset of the beginning the data element - before the first byte of the 2 bytes of the group field - starting from the beginning of the stream.


Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.