Compare two arraylist of EMF objects [message #1199623] |
Wed, 20 November 2013 18:14  |
Eclipse User |
|
|
|
Hi,
I've got two ArrayList which contains of objects from type Hardware. This class has got an Enumeration "ElementType", which should be used to compare different objects of hardware to each other.
I'm wonder now how I can make use of helper methods like java.util.AbstractCollection.containsAll to compare my ArrayLists. As the objects are different, equals method gave a false back. Is there a way to customize the equals method or solve this in another way?
Cheers,
Phil
|
|
|
Re: Compare two arraylist of EMF objects [message #1200585 is a reply to message #1199623] |
Thu, 21 November 2013 05:01  |
Eclipse User |
|
|
|
Phil,
Comments below.
On 21/11/2013 12:14 AM, Phil H wrote:
> Hi,
>
> I've got two ArrayList which contains of objects from type Hardware.
> This class has got an Enumeration "ElementType", which should be used
> to compare different objects of hardware to each other.
>
> I'm wonder now how I can make use of helper methods like
> java.util.AbstractCollection.containsAll to compare my ArrayLists.
It sounds like you should do this external to the list implementation.
> As the objects are different, equals method gave a false back. Is
> there a way to customize the equals method or solve this in another way?
It's not clear what you're hoping to achieve. Doesn't
org.eclipse.emf.ecore.util.EcoreUtil.equals(List<? extends EObject>,
List<? extends EObject>) help?
>
> Cheers,
> Phil
|
|
|
Powered by
FUDForum. Page generated in 0.13523 seconds