|
|
Re: How to retreive a list of attribut in a certain order [Solved] [message #873234 is a reply to message #872338] |
Thu, 17 May 2012 19:01 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi
asSet() will probably be quicker, since prior to sortedBy, ordering is
insignificant.
Regards
Ed Willink
On 16/05/2012 00:36, Alain Lavoie wrote:
> Alain Lavoie a écrit :
>> Hi,
>>
>> I have to generate list of element (properties) in a given
>> order (doc and other requirements).
>>
>> I have made multiple attempts without success. Here is what
>> I came from.
>>
>> [let as : Set(Property) =
>> c.attribute->select(self.toString().startsWith('associationKeyword'))]
>>
>> So, How can I get a list of properties (oclTypeOf(Property))
>> ordered by a choosen element (name, a guard, ...) ?
>>
>> Regards.
>
> Ok, finally, here is the solution:
>
> [let a : OrderedSet(Property) = b->select(p : Property |
> p.name.contains('keyword'))->asOrderedSet()->sortedBy(name) ]
>
> AL
|
|
|
|
Powered by
FUDForum. Page generated in 0.03549 seconds