[Acceleo] tokenize method returning a Bag instead of Sequence [message #1233043] |
Sat, 18 January 2014 07:39  |
Eclipse User |
|
|
|
Hi guys... according to Acceleo documentation the string method is supposed to return a Sequence(string) but in my case is returning a Bag... no idea why?
Have someone ever experienced that?
It's really important to me have a Sequence(String) instead of a Bag(String). And I don't wanna convert because it messes with the order.
Thank you.
|
|
|
Re: [Acceleo] tokenize method returning a Bag instead of Sequence [message #1233923 is a reply to message #1233043] |
Mon, 20 January 2014 16:14   |
Eclipse User |
|
|
|
Hi,
Tokenize returns a List<String> which in Acceleo is "translated" as a Sequence(String). What does this ['first.second.third.fourth.fifth'.tokenize('.')/] return for you? If it does not return a sequence with the same order (first, second, third, fourth, fifth), which version of Acceleo are you using, which version of Eclipse and which version of OCL?
Regards,
Stephane Begaudeau, Obeo
--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks
|
|
|
Re: [Acceleo] tokenize method returning a Bag instead of Sequence [message #1234868 is a reply to message #1233043] |
Wed, 22 January 2014 21:14  |
Eclipse User |
|
|
|
Hi Stephane,
I figured out the probleam. In fact, my string came from a search that I did with a 'select'.. this select was returning me a collection that wasn't a Sequence.. so I couldn't apply 'first()' operation. I was directly applying resultofsearch.name.tokenize('.')... instead of resultofsearch->asSequence->first().name.tokenize('.') to apply the operation to one single string.
I'm using the lastest versions, I guess.
Many thanks for your help. Merci vraiment pour votre aide!
|
|
|
Powered by
FUDForum. Page generated in 0.48101 seconds