public OclTuple(params TuplePart[] parts) { if (parts == null) { throw new ArgumentNullException(); } foreach (var part in parts) { this.parts[part.name] = part.value; } this.type = OclTupleType.Tuple(from x in parts select OclTupleType.Part(x.name, x.type)); }
public virtual OclSet product(OclCollection c2) { OclTupleType newElementType = OclTupleType.Tuple(OclTupleType.Part("first", elementType), OclTupleType.Part("second", c2.elementType)); OclSet set = new OclSet(newElementType); foreach (OclAny e1 in this) { foreach (OclAny e2 in c2) { set.set.Add(new OclTuple(newElementType, OclTuple.Part("first", e1), OclTuple.Part("second", e2))); } } return(set); }