Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Problem with collection
Problem with collection [message #1755527] Sat, 04 March 2017 20:40 Go to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 262
Registered: July 2016
Senior Member
Hi,

the below code returns e.g. [Node]. I want this returns Node instead of [Node]. What should I do?

e.refImmediateComposite().refImmediateComposite().targets -> select (t|t.name.name=e.lhs.target.name) -> collect (s|s.resolvedType.elementName)
Re: Problem with collection [message #1755662 is a reply to message #1755527] Mon, 06 March 2017 16:23 Go to previous messageGo to next message
louis andia. is currently offline louis andia.Friend
Messages: 47
Registered: November 2016
Member
I don't really understand but if you know your collection has only one element and want to return it outside a collection, just add ->first() at the end.
Re: Problem with collection [message #1755696 is a reply to message #1755662] Mon, 06 March 2017 20:30 Go to previous messageGo to next message
Banafsheh A is currently offline Banafsheh AFriend
Messages: 262
Registered: July 2016
Senior Member
Thank you very much indeed. My problem was solved.
Re: Problem with collection [message #1787480 is a reply to message #1755696] Sat, 26 May 2018 09:20 Go to previous messageGo to next message
ashrafur rahman is currently offline ashrafur rahmanFriend
Messages: 21
Registered: May 2018
Junior Member
This is an old topic but can you please tell me, how to return multiple elements of collection as a single sttring. Like, from this collection {'Read', 'More',' to', 'Learn'}, I want to return 'Read More' as a single string.
Re: Problem with collection [message #1787510 is a reply to message #1787480] Sun, 27 May 2018 20:36 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 371
Registered: September 2012
Location: Belgium
Senior Member

Look into https://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#Iterating_over_collections

Cheers,
Dennis
Re: Problem with collection [message #1787515 is a reply to message #1787510] Mon, 28 May 2018 06:26 Go to previous message
ashrafur rahman is currently offline ashrafur rahmanFriend
Messages: 21
Registered: May 2018
Junior Member
Thank you Dennis.
Previous Topic:[EMFTVM] Empty output model with programatically generated meta- and inputmodel
Next Topic:Prevent the ATL build to overwrite the properties file
Goto Forum:
  


Current Time: Sat Jul 21 09:59:33 GMT 2018

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

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

Back to the top