Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] select distinct
[Acceleo] select distinct [message #904502] Tue, 28 August 2012 14:44 Go to next message
Andrea Sindico is currently offline Andrea SindicoFriend
Messages: 266
Registered: November 2010
Senior Member

Is it possible to get the distinct elements of a set?
Suppose I need to include the header files of the types of my classifiers' properties. I'd like to include each header file once though there are more than one property with that type.


Follow me on Twitter @andreasindico

Re: [Acceleo] select distinct [message #904506 is a reply to message #904502] Tue, 28 August 2012 14:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4189
Registered: July 2009
Senior Member
Hi

All elements of a Set are inherently distinct.

If you want a different distinction criterion perhaps you want
->isUnique(...) or just a Set of your alterante view.

Regards

Ed Willink

On 28/08/2012 15:44, Andrea Sindico wrote:
> Is it possible to get the distinct elements of a set? Suppose I need
> to include the header files of the types of my classifiers'
> properties. I'd like to include each header file once though there are
> more than one property with that type.
Re: [Acceleo] select distinct [message #904798 is a reply to message #904506] Wed, 29 August 2012 07:16 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1639
Registered: July 2009
Senior Member
Hi Andrea,

To complete Ed's answer, if you have a collection which is not unique and need all distinct entries it contain, convert it to a set :

[collection->asSet()/]


or if you need the order to be constant

[collection->asOrderedSet()/]


Laurent Goubet
Obeo
Previous Topic:[Acceleo] Standalone problem
Next Topic:[Acceleo] select over a Set(String) object
Goto Forum:
  


Current Time: Mon Dec 22 18:43:25 GMT 2014

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

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