|
Re: [XCORE] how to create an EList in an operation [message #1265929 is a reply to message #1265913] |
Thu, 06 March 2014 19:09 |
Ed Merks Messages: 33158 Registered: July 2009 |
Senior Member |
|
|
Roger,
You can define a data type that wraps any existing Java type, e.g., type
List<E> wraps java.util.List. Xbase provides more elegant ways to
express this type of thing. Look at some of the nice Xtend examples
(becaue Xtend also uses Xbase)...
On 06/03/2014 7:39 PM, Roger Gilliar wrote:
> Hi,
>
> I trying to write the following operation:
>
> op ChannelDescription[] channels() {
> var ChannelDescription[] channels
> for (Module module : modules) {
> channels.addAll(module.channelDescription)
> }
> return channels
> }
>
> This gives me a type mismatch error. And how do I create a List of
> ChannelDescriptions ? The purpose of this op is to flatten the module
> list and to return a list of all ChannelDescriptions from all modules.
>
> Regards
> Rpger
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03216 seconds