#!/usr/bin/env python
from coral import *

UML14=Language.__getLanguage__("UML",1,4)
UML14Model = UML14.getElement("Model")
UML14Class = UML14.getElement("Class")

m=UML14Model(name="model")

for n in range(10):
    c=UML14Class(name="class"+str(n))
    m.ownedElement.insert(c)

print m.ownedElement
print m.ownedElement.select(lambda e: e.name=="class2")

print m.ownedElement.collect(lambda e: e)

print m.ownedElement.collect(lambda e: e.__getSlotByName__("name")[0])

print m.ownedElement.collect(lambda e: e.name)

print m.ownedElement.name
    

