Example #1
0
        public virtual OclBoolean includesAll(OclCollection c2)
        {
            HashSet <OclAny> set1 = new HashSet <OclAny>(this);
            HashSet <OclAny> set2 = new HashSet <OclAny>(c2);

            return((OclBoolean)set1.IsSupersetOf(set2));
        }
Example #2
0
        public virtual OclBoolean excludesAll(OclCollection c2)
        {
            HashSet <OclAny> set1 = new HashSet <OclAny>(this);
            HashSet <OclAny> set2 = new HashSet <OclAny>(c2);

            return((OclBoolean) !set1.Overlaps(set2));
        }
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);
        }