Esempio n. 1
0
        public AndOrFormula(AndOrFormula another)
        {
            Atom refAtom = null;
            And refAnd = null;
            Or refOr = null;

            try
            {
                if (another.Atom != null)
                {
                    refAtom = (Atom)another.Atom.Clone();
                }

                if (another.InnerAnd != null)
                {
                    refAnd = (And)another.InnerAnd.Clone();
                }

                if (another.InnerOr != null)
                {
                    refOr = (Or)another.InnerOr.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            atom = refAtom;
            and = refAnd;
            or = refOr;
        }
Esempio n. 2
0
        public Integrity(Integrity another)
        {
            Oid refOid = null;
            Atom refAtom = null;
            Or refOr = null;
            And refAnd = null;
            AndOrFormula refFormula = null;

            try
            {
                if (another.Oid != null)
                {
                    refOid = (Oid)another.Oid.Clone();
                }

                if (another.Atom != null)
                {
                    refAtom = (Atom)another.Atom.Clone();
                }

                if (another.InnerOr != null)
                {
                    refOr = (Or)another.InnerOr.Clone();
                }

                if (another.InnerAnd != null)
                {
                    refAnd = (And)another.InnerAnd.Clone();
                }

                if (another.Formula != null)
                {
                    refFormula = (AndOrFormula)another.Formula.Clone();
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
            and = refAnd;
            or = refOr;
            formula = refFormula;
            atom = refAtom;
        }
Esempio n. 3
0
 public int AddFormula(AndOrFormula item)
 {
     return formula.Add(item);
 }
Esempio n. 4
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            AndOrFormula other = new AndOrFormula((AndOrFormula)o);

            if (this.Atom != null)
            {
                if (!this.Atom.Equals(other.Atom))
                {
                    return false;
                }
            }

            if (this.InnerOr != null)
            {
                if (!this.InnerOr.Equals(other.InnerOr))
                {
                    return false;
                }
            }

            if (this.InnerAnd != null)
            {
                if (!this.InnerAnd.Equals(other.InnerAnd))
                {
                    return false;
                }
            }

            return true;
        }