public Assert(Assert another) { Oid refOid = null; formula = new ArrayList(); try { if (another.Oid != null) { refOid = (Oid)another.Oid.Clone(); } if (another.Formula != null) { AssertFormula[] items = (AssertFormula[])another.Formula.Clone(); formula.Clear(); foreach (AssertFormula item in items) { formula.Add(new AssertFormula(item)); } } } catch (Exception e) { e.ToString(); } oid = refOid; }
public int CompareTo(object o) { Assert another = new Assert((Assert)o); if (another.formula != null && formula != null) { return ((AssertFormula)formula[0]).CompareTo((AssertFormula)another.formula[0]); } return 0; }
public override bool Equals(object o) { if (o == null || GetType() != o.GetType()) { return false; } Assert other = new Assert((Assert)o); if (this.oid != null) { if (!this.Oid.Equals(other.Oid)) { return false; } } if (this.formula.Count != other.formula.Count) { return false; } for (int i = 0; i < formula.Count; i++) { if (!formula[i].Equals(other.Formula[i])) { return false; } } return true; }
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; }