commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Pfau" <mp...@northernideas.de>
Subject RE: [lang] EqualsBuilder: Comparison of Collections
Date Tue, 31 Jan 2006 18:33:04 GMT
Hello,

> Stephen Colebourne:
> This is a misunderstanding of the java collections framework.
> 
> The framework consists of three collections interfaces - 
> Collection, Set and List.
> 
> Two List implementations are equal based on their order.
> Two Set implementations are equal based on their content.
> Two Collection implementations have no defined equals behaviour.
> 
> If you want to achieve equals comparison based on content 
> without order, then simply create two HashSet objects instead 
> of two ArrayList objects.

Thank you for welcoming and correcting me on this Stephen, you are
absolutely right! You proposed to use a HashSet in order to compare
Collections for equality based on their content. However, in the current
State of the EqualsBuilder, it is not possible to use it in order to compare
HashSets... 

So wouldn't it be useful to add such an operation?

Kind Regards,
Matthias


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message