[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmt] Re: [Epsilon][EVL] Printing collections

Hi Andrew,

You can print a Collection as a string using the concat(delimiter:String) operation. E.g.

Sequence{1, 'Apple', 2}.concat(':').println() prints 1:Apple:2

Cheers,
Dimitrios

Andrew Lawson wrote:
I'm having trouble comparing two collections.

I create the collections by following a reference from the start entity (in this case named parent) and then following a link named operations and then collecting together all of the name attributes of the classes.

Is there anyway to print the collections in EVL so that I can see what collections are being compared?

self.parent.operations->collect(s| s.name)



The relevant parts of the metamodel are:

class Entity {

  attr String classname;

  attr String instancename;

  attr Boolean Child;

  val Attribute[+] attribute;

  val Operation[*] operations;

  val EntityReference[+] reference;

  ref Entity[0..1] parent;

}





class Operation{



    attr String name;

      val Type[*] arguments;

                }