Re: [collections] [proposal] Bag interface change

2003-12-29 Thread Michael Heuer

Stephen Colebourne wrote:

 I am proposing to change the Bag interface.
 http://jakarta.apache.org/commons/collections/api/org/apache/commons/collections/Bag.html

 Add:
 equals(Object) - Two Bags are equal if they contain the same number of
 occurrences of all the same elements.
 hashCode() - The hashCode is defined as the sum total of each elements
 hashcode, where the hashcode for an element is defined as (e==null   ? 0 :
 e.hashCode()) ^ noOccurances)

 This will enable Bags to be compared.

I'm seeing a problem related to this change with an unit test for a class
that extends AbstractBagDecorator, but this failure doesn't show up in the
[collections] unit tests.

Will investigate further.

   michael


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [collections] [proposal] Bag interface change

2003-12-29 Thread Michael Heuer

On Mon, 29 Dec 2003, Michael Heuer wrote:

 Stephen Colebourne wrote:

  I am proposing to change the Bag interface.
  http://jakarta.apache.org/commons/collections/api/org/apache/commons/collections/Bag.html
 
  Add:
  equals(Object) - Two Bags are equal if they contain the same number of
  occurrences of all the same elements.
  hashCode() - The hashCode is defined as the sum total of each elements
  hashcode, where the hashcode for an element is defined as (e==null   ? 0 :
  e.hashCode()) ^ noOccurances)
 
  This will enable Bags to be compared.

 I'm seeing a problem related to this change with an unit test for a class
 that extends AbstractBagDecorator, but this failure doesn't show up in the
 [collections] unit tests.

Never mind, my [collections] snapshot jar file was out of date in my local
repository.

   michael


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [collections] [proposal] Bag interface change

2003-12-24 Thread Stephen Colebourne
Change subject so it passes mail filters ;-)

From: Stephen Colebourne [EMAIL PROTECTED]
 I am proposing to change the Bag interface.

http://jakarta.apache.org/commons/collections/api/org/apache/commons/collect
 ions/Bag.html

 Add:
 equals(Object) - Two Bags are equal if they contain the same number of
 occurrences of all the same elements.
 hashCode() - The hashCode is defined as the sum total of each elements
 hashcode, where the hashcode for an element is defined as (e==null   ? 0 :
 e.hashCode()) ^ noOccurances)

 This will enable Bags to be compared.

 I am tempted to change the rest of the interface, to fix the violations of
 Collection, however that is probably a bad idea.

 Stephen



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]