Find instances of an EClass [message #910678] |
Mon, 10 September 2012 07:50 |
Eclipse User |
|
|
|
Hello,
this seems like an extremely trivial FAQ kind of question, yet I wasn't
able to find anything:
Given one/a set of root EObject or a Resource, how can I obtain a list
of all instances of an EClass?
I know I can use EcoreUtil.getAllProperContents() and iterate over all
objects, but I was hoping that there is a better performing way for
this. Is there perhaps a way to use any of the CrossReferencers for this?
TIA
Marius
|
|
|
Re: Find instances of an EClass [message #910680 is a reply to message #910678] |
Mon, 10 September 2012 07:52 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Marius,
Nothing tracks all instances so the only way is to visit all possible
objects and filter that down to the ones you want.
On 10/09/2012 9:50 AM, Marius Gröger wrote:
> Hello,
>
> this seems like an extremely trivial FAQ kind of question, yet I wasn't
> able to find anything:
>
> Given one/a set of root EObject or a Resource, how can I obtain a list
> of all instances of an EClass?
>
> I know I can use EcoreUtil.getAllProperContents() and iterate over all
> objects, but I was hoping that there is a better performing way for
> this. Is there perhaps a way to use any of the CrossReferencers for this?
>
> TIA
> Marius
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02946 seconds