Example #1
0
        public Query(Query another)
        {
            formula = new ArrayList();
            Oid refOid = null;

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

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

            oid = refOid;
        }
Example #2
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Query other = new Query((Query)o);

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

            if (Formula.Length != other.Formula.Length)
            {
                return false;
            }

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

            return true;
        }
Example #3
0
        public RuleML(RuleML another)
        {
            Oid refOid = null;
            Assert refAssert = null;
            Query refQuery = null;
            Protect refProtect = null;
            parent = new ArrayList();
            try
            {
                if (another.Assert != null)
                {
                    refAssert = (Assert)another.Assert.Clone();
                }

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

                if (another.Query != null)
                {
                    refQuery = (Query)another.Query.Clone();
                }

                if (another.Protect != null)
                {
                    refProtect = (Protect)another.Protect.Clone();
                }

                if (another.Parent != null)
                {
                    int[] items = (int[])another.Parent.Clone();
                    parent.Clear();
                    foreach (int item in items)
                    {
                        parent.Add(item);
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            assert = refAssert;
            oid = refOid;
            protect = refProtect;
            query = refQuery;
            id = another.id;
        }