Example #1
0
 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));
 }
Example #2
0
 public OclTuple(OclTupleType type, params TuplePart[] parts)
 {
     if (type == null || parts == null)
     {
         throw new ArgumentNullException();
     }
     foreach (var part in parts)
     {
         this.parts[part.name] = part.value;
     }
     this.type = type;
 }
Example #3
0
        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);
        }