dcsimg
What is the java recommended standard interface for a generic tree data structure ?
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sandesh_Pande
Posted On:   Tuesday, June 5, 2001 04:48 PM

I wish to write an implementation of a tree data structure. In the interest of reusability, i would like to provide it's functionality through a standard interface, if any has been defined by Java/J2EE. But when i see the API, java.util has no particular interface that models a tree. There are two classes TreeMap and TreeSet but they actually model an ordered Map and Set respectively (so it seems) and lack the fuctionality that i would expect from a tree or treenode ie. parent(), children(), root(), isLeaf() etc...

So, what is the java recommended standard interface for a tree data structure ?

Thanks in advance.

- Sandesh

Re: What is the java recommended standard interface for a generic tree data structure ?

Posted By:   Sandip_Chitale  
Posted On:   Saturday, June 9, 2001 10:35 PM

Other alternative could be javax.swing.text.Document and javax.swing.text.Element.


Third alternative could be the xml DOM
structure. See -


http://java.sun.com/xml/jaxp-1.0.1/docs/api/org/w3c/dom/Document.html

Re: What is the java recommended standard interface for a generic tree data structure ?

Posted By:   Michael_Wax  
Posted On:   Tuesday, June 5, 2001 05:15 PM

The closest things in the standard API are the Swing TreeModel and TreeNode interfaces. If you adhere to these, then you may use your classes with the JTree class.
About | Sitemap | Contact