Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » finding all specializations of a classifier
finding all specializations of a classifier [message #473028] Tue, 29 May 2007 21:02 Go to next message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Is there any EMF or UML2 utility or trick for finding all
specializations of a classifier? I will only search among models loaded
in the same ResourceSet. I am wondering if there is something more
efficient than a UMLSwitch that tests all Generalizations in the tree
iterator.

Thanks!
Dave Carlson
Re: finding all specializations of a classifier [message #473029 is a reply to message #473028] Tue, 29 May 2007 21:29 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Dave,

I belive you could do something like ...

myClassifier.getTargetDirectedRelationships(UMLPackage.Liter als.GENERALIZATI
ON);

... then call getSources() from all those relationships. That should give
you all the elements that directly specialize your classifier.

You might also want to look at Element.getRelationships(...).

Hope that helps.

- James



"Dave Carlson" <dcarlson@xmlmodeling.com> wrote in message
news:f3i4dr$nic$1@build.eclipse.org...
> Is there any EMF or UML2 utility or trick for finding all
> specializations of a classifier? I will only search among models loaded
> in the same ResourceSet. I am wondering if there is something more
> efficient than a UMLSwitch that tests all Generalizations in the tree
> iterator.
>
> Thanks!
> Dave Carlson
Re: finding all specializations of a classifier [message #473031 is a reply to message #473029] Tue, 29 May 2007 21:59 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Thanks, James, exactly what I was looking for. I can always count on
the UML2 newsgroup for a lightening fast response :-)

Dave

James Bruck wrote:
> Hi Dave,
>
> I belive you could do something like ...
>
> myClassifier.getTargetDirectedRelationships(UMLPackage.Liter als.GENERALIZATI
> ON);
>
> .. then call getSources() from all those relationships. That should give
> you all the elements that directly specialize your classifier.
>
> You might also want to look at Element.getRelationships(...).
>
> Hope that helps.
>
> - James
Re: finding all specializations of a classifier [message #618177 is a reply to message #473028] Tue, 29 May 2007 21:29 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Dave,

I belive you could do something like ...

myClassifier.getTargetDirectedRelationships(UMLPackage.Liter als.GENERALIZATI
ON);

... then call getSources() from all those relationships. That should give
you all the elements that directly specialize your classifier.

You might also want to look at Element.getRelationships(...).

Hope that helps.

- James



"Dave Carlson" <dcarlson@xmlmodeling.com> wrote in message
news:f3i4dr$nic$1@build.eclipse.org...
> Is there any EMF or UML2 utility or trick for finding all
> specializations of a classifier? I will only search among models loaded
> in the same ResourceSet. I am wondering if there is something more
> efficient than a UMLSwitch that tests all Generalizations in the tree
> iterator.
>
> Thanks!
> Dave Carlson
Re: finding all specializations of a classifier [message #618179 is a reply to message #473029] Tue, 29 May 2007 21:59 Go to previous message
Dave Carlson is currently offline Dave CarlsonFriend
Messages: 402
Registered: July 2009
Senior Member
Thanks, James, exactly what I was looking for. I can always count on
the UML2 newsgroup for a lightening fast response :-)

Dave

James Bruck wrote:
> Hi Dave,
>
> I belive you could do something like ...
>
> myClassifier.getTargetDirectedRelationships(UMLPackage.Liter als.GENERALIZATI
> ON);
>
> .. then call getSources() from all those relationships. That should give
> you all the elements that directly specialize your classifier.
>
> You might also want to look at Element.getRelationships(...).
>
> Hope that helps.
>
> - James
Previous Topic:finding all specializations of a classifier
Next Topic:How to specify EMap
Goto Forum:
  


Current Time: Sun Nov 10 19:16:44 GMT 2024

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

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

Back to the top