Skip to main content



      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 14:40 Go to next message
Eclipse UserFriend
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 14:58] by 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 17:40 Go to previous message
Eclipse UserFriend
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:When running genmodel, different developers get different results
Goto Forum:
  


Current Time: Mon Jul 14 02:44:43 EDT 2025

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

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

Back to the top