commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
Subject [collectiions] [proposal] Bag interface change
Date Wed, 24 Dec 2003 21:15:29 GMT
I am proposing to change the Bag interface.

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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message