Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What collection works best for maintaining a family tree, where each node can have multiple parents and multiple children, spouse relationships, etc.?

0
Posted

What collection works best for maintaining a family tree, where each node can have multiple parents and multiple children, spouse relationships, etc.?

0

Location: http://www.jguru.com/faq/view.jsp?EID=26298 Created: Mar 20, 2000 Modified: 2000-03-20 17:42:30.647 Author: Joseph Shelby (http://www.jguru.com/guru/viewbio.jsp?EID=26292) Question originally posed by John Zukowski PREMIUM (http://www.jguru.com/guru/viewbio.jsp?EID=7 With Collections by themselves, there isn’t one. What you’re asking for is a Labeled Directed Graph (A directed graph where the graph edges have labels describing the relationship). A rather complex object. You’d have to design that yourself (though you can use Collection objects like Lists in the implementation as a convenience), and design Comparators to support your final implementation classes of a “FamilyTreePerson” for sorting purposes (like sort by name or sort by birthdate, etc.). After that, you have to decide what “Iteration” over the tree really means and define Iterator classes over the Graph. After that, completing the Collection interface should be pretty simple. In other words, you’ve got a lot of

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123