Esempio n. 1
0
 public OclSet intersection(OclSet set)
 {
     if (IsNull(set))
     {
         throw new ArgumentNullException();
     }
     //Use Set implementation
     return(set.intersection(this));
 }
Esempio n. 2
0
        protected OclSet ClosureToSet <T>(OclClassifier newElementType, Func <T, OclAny> body)
            where T : OclAny
        {
            OclSet resultSet = new OclSet(newElementType);

            ClosureTo(newElementType, this, resultSet.set, body);

            return(resultSet);
        }
Esempio n. 3
0
        public OclBag union(OclClassifier newElementType, OclSet set)
        {
            if (IsNull(set))
            {
                throw new ArgumentNullException();
            }
            OclBag bg = new OclBag(newElementType, map);

            bg.AddRange(set);
            return(bg);
        }
Esempio n. 4
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);
        }