Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to find if two model elements have the same children?
How to find if two model elements have the same children? [message #1806245] Mon, 06 May 2019 18:40 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi,

I was wondering if there is a utility function to determine if two model elements have the same children? For instance, if two classes in the transitions in a state-machine have the same event, guard, and effect.

If not, another way would be traversing through all the children and check one by one, I assume. Or can we simply compare ele1.eAllcontents() and ele2.eAllcontents() ?

Thanks,
Parsa

[Updated on: Mon, 06 May 2019 18:58]

Report message to a moderator

Re: How to find if two model elements have the same children? [message #1806250 is a reply to message #1806245] Mon, 06 May 2019 21:40 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30203
Registered: July 2009
Senior Member
EcoreUtil.equals is helpful for testing for structural equality. It uses org.eclipse.emf.ecore.util.EcoreUtil.EqualityHelper which could be specialized to do structural equality checking some other way.
Previous Topic:EMF Element Binding to TreeViewer
Next Topic:Problem using xcode
Goto Forum:
  


Current Time: Sat Jun 15 21:13:00 GMT 2019

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

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

Back to the top