org.dicom4j.io.directory
Class DicomDirectoryItem

java.lang.Object
  extended by org.dicom4j.io.directory.DicomDirectoryItem
All Implemented Interfaces:
Comparable, TreeNode
Direct Known Subclasses:
ConcatenationDirectoryItem, ImageDirectoryItem, PatientDirectoryItem, SeriesDirectoryItem, StudyDirectoryItem, TopDirectoryItem

public abstract class DicomDirectoryItem
extends Object
implements Comparable, TreeNode

base class for DICOMDIR's items

Since:
0.0.4
Author:
Laurent Lecomte

Constructor Summary
DicomDirectoryItem(DicomDirectoryItem p, DataSet l)
           
DicomDirectoryItem(DirectoryRecordType aDirectoryRecordType, DicomDirectoryItem p, DataSet l)
           
 
Method Summary
 void addChild(DicomDirectoryItem child)
           
 void addSibling(DicomDirectoryItem sibling)
           
 Enumeration children()
           Returns the children of this node as an Enumeration.
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 boolean getAllowsChildren()
           Always returns true, since children may always be added.
 TreeNode getChildAt(int index)
           Returns the child at the specified index.
 int getChildCount()
           Return the number of children that this node contains.
 DataSet getDataSet()
           
 int getIndex(TreeNode child)
           Returns the index of the specified child from amongst this node's children, if present.
 TreeNode getParent()
          return the parent node
 DirectoryRecordType getType()
           
 boolean isLeaf()
           Returns true if the receiver is a leaf (has no children).
 void removeChild(DicomDirectoryItem child)
           
 void setUID(String uid)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DicomDirectoryItem

public DicomDirectoryItem(DicomDirectoryItem p,
                          DataSet l)
Parameters:
p -
l -

DicomDirectoryItem

public DicomDirectoryItem(DirectoryRecordType aDirectoryRecordType,
                          DicomDirectoryItem p,
                          DataSet l)
Parameters:
p -
l -
Method Detail

addChild

public void addChild(DicomDirectoryItem child)
Parameters:
child -

addSibling

public void addSibling(DicomDirectoryItem sibling)
                throws DicomException
Parameters:
sibling -
Throws:
DicomException

setUID

public void setUID(String uid)

children

public Enumeration children()

Returns the children of this node as an Enumeration.

Specified by:
children in interface TreeNode
Returns:
the children of this node

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
Parameters:
o -

equals

public boolean equals(Object o)
Overrides:
equals in class Object
Parameters:
o -

getAllowsChildren

public boolean getAllowsChildren()

Always returns true, since children may always be added.

Specified by:
getAllowsChildren in interface TreeNode
Returns:
always true

getChildAt

public TreeNode getChildAt(int index)

Returns the child at the specified index.

Specified by:
getChildAt in interface TreeNode
Parameters:
index - the index of the child to be returned, numbered from 0
Returns:
the child TreeNode at the specified index

getChildCount

public int getChildCount()

Return the number of children that this node contains.

Specified by:
getChildCount in interface TreeNode
Returns:
the number of children, 0 if none

getDataSet

public DataSet getDataSet()

getIndex

public int getIndex(TreeNode child)

Returns the index of the specified child from amongst this node's children, if present.

Specified by:
getIndex in interface TreeNode
Parameters:
child - the child to search for amongst this node's children
Returns:
the index of the child, or -1 if not present

getParent

public TreeNode getParent()
return the parent node

Specified by:
getParent in interface TreeNode
Returns:
the parent node, or null if root

getType

public DirectoryRecordType getType()

isLeaf

public boolean isLeaf()

Returns true if the receiver is a leaf (has no children).

Specified by:
isLeaf in interface TreeNode
Returns:
true if the receiver is a leaf

removeChild

public void removeChild(DicomDirectoryItem child)
Parameters:
child -

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 dicom4j. All Rights Reserved.