Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Compare two arraylist of EMF objects
Compare two arraylist of EMF objects [message #1199623] Wed, 20 November 2013 23:14 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member
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 10:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:EMF/Xtext resource handling
Next Topic:How to define a predefined sequence attributes?
Goto Forum:
  


Current Time: Fri Mar 29 14:05:15 GMT 2024

Powered by FUDForum. Page generated in 0.02645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top