Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » using a hashmap in Acceleo
using a hashmap in Acceleo [message #1663204] Tue, 10 March 2015 10:10 Go to next message
Rafael Merino Garcia is currently offline Rafael Merino GarciaFriend
Messages: 2
Registered: February 2015
Junior Member
I was wondering whether or not OCL and Acceleo support working with maps (HashMap,HashSet ...)
I'm trying to wrap a query with a java service and return a hashmap in order to iterate through it in a template. Otherwise I'd have to make two different queries and return two list, one for the keys and another for the values...
Regards
Re: using a hashmap in Acceleo [message #1663733 is a reply to message #1663204] Tue, 10 March 2015 15:12 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

A Set has been part of OCL (and Acceleo) since forever.

A Map is on the to-do list for OCL 2.5.

Acceleo gives you an ability to invoke Java so you can craft your own.

If you're really enthusiastic you can sort of emulate a Map with a Set
of Tuples.

Regards

Ed Willink


On 10/03/2015 10:10, Rafael Merino Garcia wrote:
> I was wondering whether or not OCL and Acceleo support working with
> maps (HashMap,HashSet ...)
> I'm trying to wrap a query with a java service and return a hashmap in
> order to iterate through it in a template. Otherwise I'd have to make
> two different queries and return two list, one for the keys and
> another for the values...
> Regards
Previous Topic:SysML activity diagram output pins.
Next Topic:Flatten Sequence(String) to String
Goto Forum:
  


Current Time: Fri Apr 26 13:30:12 GMT 2024

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

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

Back to the top