[Collections][SUBMIT] TreeNode and friends

2002-06-08 Thread Stephen Colebourne
Hi, I have completed the updates proposed in the last discussion on trees. The tree node code now contains: TreeNode - a simple list based tree node interface ArrayTreeNode - an implementation based on ArrayList TreeUtils - a group of useful utilities for managing trees TestArrayTreeNode - a test

RE: [Collections][Submit] TreeNode and friends

2002-05-29 Thread Jack, Paul
:[EMAIL PROTECTED]] Sent: Monday, May 27, 2002 11:19 AM To: Jakarta Commons Developers List Subject: Re: [Collections][Submit] TreeNode and friends From: Kief Morris [EMAIL PROTECTED] I would rather keep the iterator on TreeNode. If there are only two standard ways to iterate then two

Re: [Collections][Submit] TreeNode and friends

2002-05-29 Thread Stephen Colebourne
of? Stephen -Paul -Original Message- From: Stephen Colebourne [mailto:[EMAIL PROTECTED]] Sent: Monday, May 27, 2002 11:19 AM To: Jakarta Commons Developers List Subject: Re: [Collections][Submit] TreeNode and friends From: Kief Morris [EMAIL PROTECTED] I would rather keep

Re: [Collections][Submit] TreeNode and friends

2002-05-27 Thread Kief Morris
Stephen Colebourne typed the following on 07:48 PM 5/26/2002 +0100 4. Must tree iterators be depth-first? The ordered traversal for a heap tree isn't depth-first. No, but depth first is the one I needed ;-) There are two possibilities here, a) Add extra methods for different

Re: [Collections][Submit] TreeNode and friends

2002-05-27 Thread Stephen Colebourne
From: Kief Morris [EMAIL PROTECTED] I would rather keep the iterator on TreeNode. If there are only two standard ways to iterate then two methods would seem appropriate. But are there more than two ways?? I favor a single iterator() method on the interface which returns the nodes in an

Re: [Collections][Submit] TreeNode and friends

2002-05-26 Thread bob mcwhirter
3. What's the rationale for having equals and hashCode be reference based? The alternative is to compare both the value and children of that node. But in comparing the children, each child node will compare its value and children and so on. This would be potentially very expensive. Its

Re: [Collections][Submit] TreeNode and friends

2002-05-26 Thread Stephen Colebourne
From: bob mcwhirter [EMAIL PROTECTED] 3. What's the rationale for having equals and hashCode be reference based? The alternative is to compare both the value and children of that node. But in comparing the children, each child node will compare its value and children and so on.

RE: [Collections][Submit] TreeNode and friends

2002-05-24 Thread Jack, Paul
Some Feedback: TreeNode: 1. Should it extend Cloneable? Some trees might not be able to be Cloneable effectively (for instance, a Btree backed by a file). 2. I think we should allow setValue to throw an UnsupportedOperationException for unmodifiable trees. 3. What's the rationale for

[Collections][Submit] TreeNode and friends

2002-05-23 Thread Stephen Colebourne
The following link contains a submission to collections of classes to cover trees: http://www.scolebourne.eurobell.co.uk/TreeNode.zip This was discussed earlier in the year, but failed to come to a conclusion due to other commitments of Kief Morris at that time. I have now implemented an API for

[Collections][Submit] TreeNode and friends

2002-05-23 Thread Stephen Colebourne
The following link contains a submission to collections of classes to cover trees: http://www.scolebourne.eurobell.co.uk/TreeNode.zip This was discussed earlier in the year, but failed to come to a conclusion due to other commitments of Kief Morris at that time. I have now implemented an API for