|
Re: ordering of eContents [message #415996 is a reply to message #415993] |
Tue, 15 January 2008 16:17 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Sven,
No, there's nothing in EMF that keeps a temporal order. The order in
features is the order in which they are inserted in the list. The
overall eContents() order across features is controlled by the order of
the features in the EClass and then within features, the order in which
they appear in their list. If you define a type with mixed content,
then all the features would defer to the mixed content feature and in
that case you'd get things in a mixed order (which might not actually
conform to the schema).
Sven Efftinge wrote:
> I'm sure this has been asked before, but i couldn't find it. So here I
> go:
>
> Does the ordering of the list returned by eContents() depend on the
> order in which the elements have been added?
>
> For example, if I have an EClass 'Model' with two containment refs
> 'imports' and 'types'
> and I add elements to it like so:
>
> model.getImports().add(impA);
> model.getTypes().add(typeX);
> model.getImports().add(impB);
>
> Should I always get a list ordered like {impA, typeX, impB} when
> invoking eContents() afterwards?
> I do not, but I want to make sure that this is intended.
>
> thanks,
> Sven
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03340 seconds