Ejemplo n.º 1
0
        public QueryFormula(QueryFormula another)
        {
            formula = new ArrayList();
            Atom refAtom = null;
            Exist refExist = null;

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

                if (another.Exist != null)
                {
                    refExist = (Exist)another.Exist.Clone();
                }

                if (another.Formula != null)
                {
                    AndOrFormula[] items = (AndOrFormula[])another.Formula.Clone();
                    formula.Clear();
                    foreach (AndOrFormula item in items)
                    {
                        formula.Add(new AndOrFormula(item));
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            atom = refAtom;
            Exist = refExist;
        }
Ejemplo n.º 2
0
        public Exist(Exist another)
        {
            Oid refOid = null;
            QueryFormula refFormula = null;
            declare = new ArrayList();

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

                if (another.Declare != null)
                {
                    Declare[] items = (Declare[])another.Declare.Clone();
                    declare.Clear();
                    foreach (Declare item in items)
                    {
                        declare.Add(new Declare(item));
                    }
                }

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

            oid = refOid;
            formula = refFormula;
        }
Ejemplo n.º 3
0
 public int AddFormula(QueryFormula item)
 {
     return formula.Add(item);
 }
Ejemplo n.º 4
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            QueryFormula other = new QueryFormula((QueryFormula)o);

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

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

            for (int i = 0; i < Formula.Length; i++)
            {
                if (!Formula[i].Equals(other.Formula[i]))
                {
                    return false;
                }
            }

            return true;
        }