Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Accessing a set that's actually a sequence
Accessing a set that's actually a sequence [message #540533] Wed, 16 June 2010 13:13 Go to next message
Eclipse UserFriend
Originally posted by: kris.robertson.atosorigin.com

I'm working with a metamodel (not mine) which describes a multiplicity
many reference as being unordered. Acceleo therefore returns the
reference as a set.

Having seen the implementation, however, I know that the reference is
actually stored in an ordered list.

Is there any way for me to access the collection in it's ordered state?
Re: Accessing a set that's actually a sequence [message #540570 is a reply to message #540533] Wed, 16 June 2010 14:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kris.robertson.atosorigin.com

On 16/06/2010 15:13, Kris Robertson wrote:
>
> I'm working with a metamodel (not mine) which describes a multiplicity
> many reference as being unordered. Acceleo therefore returns the
> reference as a set.
>
> Having seen the implementation, however, I know that the reference is
> actually stored in an ordered list.
>
> Is there any way for me to access the collection in it's ordered state?
>
>

Okay eContents(T) does the job.
Re: Accessing a set that's actually a sequence [message #540810 is a reply to message #540570] Thu, 17 June 2010 12:30 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1638
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090103000706030207020205
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi Kris,

Happy to see that you found a workaround, as your first issue is pure
OCL : an "unordered" reference will be returned in a Set, and you would
have had to reorder afterwards through "->sortBy()" or "->asOrderedSet()".

Laurent Goubet
Obeo

Kris Robertson wrote:
> On 16/06/2010 15:13, Kris Robertson wrote:
>>
>> I'm working with a metamodel (not mine) which describes a multiplicity
>> many reference as being unordered. Acceleo therefore returns the
>> reference as a set.
>>
>> Having seen the implementation, however, I know that the reference is
>> actually stored in an ordered list.
>>
>> Is there any way for me to access the collection in it's ordered state?
>>
>>
>
> Okay eContents(T) does the job.


--------------090103000706030207020205
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

begin:vcard
fn:Laurent Goubet
n:Goubet;Laurent
org:<a href="http://www.obeo.fr">Obeo</a>
email;internet:laurent.goubet@obeo.fr
url:http://www.obeo.fr
version:2.1
end:vcard


--------------090103000706030207020205--
Previous Topic:[Acceleo] No common supertype error
Next Topic:[Xpand]duplication problem in html report
Goto Forum:
  


Current Time: Fri Nov 28 21:04:11 GMT 2014

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

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