示例#1
0
文件: OclBag.cs 项目: mff-uk/exolutio
 public OclSet intersection(OclSet set)
 {
     if (IsNull(set))
     {
         throw new ArgumentNullException();
     }
     //Use Set implementation
     return(set.intersection(this));
 }
示例#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);
        }
示例#3
0
文件: OclBag.cs 项目: mff-uk/exolutio
        public OclBag union(OclClassifier newElementType, OclSet set)
        {
            if (IsNull(set))
            {
                throw new ArgumentNullException();
            }
            OclBag bg = new OclBag(newElementType, map);

            bg.AddRange(set);
            return(bg);
        }
示例#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);
        }