Esempio n. 1
0
 public Degree(Degree another)
 {
     if (another.Data != null)
     {
         data = (string)another.Data.Clone();
     }
 }
Esempio n. 2
0
        public override bool Equals(object o)
        {
            if (o == null || GetType() != o.GetType())
            {
                return false;
            }

            Degree other = new Degree((Degree)o);

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

            return true;
        }
Esempio n. 3
0
        public Atom(Atom another)
        {
            Oid refOid = null;
            individual = new ArrayList();
            variable = new ArrayList();
            slot = new ArrayList();
            data = new ArrayList();
            variableNames = new ArrayList();
            variableValues = new ArrayList();
            Degree refDegree = null;
            Operator refOperator = null;

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

                if (another.Degree != null)
                {
                    refDegree = (Degree)another.Degree.Clone();
                }

                if (another.Operator != null)
                {
                    refOperator = (Operator)another.Operator.Clone();
                }

                if (another.Data != null)
                {
                    string[] items = (string[])another.Data.Clone();
                    foreach (string item in items)
                    {
                        data.Add(new string(item.ToCharArray()));
                    }
                }

                if (another.Individual != null)
                {
                    string[] items = (string[])another.Individual.Clone();
                    foreach (string item in items)
                    {
                        individual.Add(new string(item.ToCharArray()));
                    }
                }

                if (another.Variable != null)
                {
                    string[] items = (string[])another.Variable.Clone();
                    foreach (string item in items)
                    {
                        variable.Add(new string(item.ToCharArray()));
                    }
                }

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

                if (another.VariableNames != null)
                {
                    string[] items = (string[])another.VariableNames.Clone();
                    foreach (string item in items)
                    {
                        variableNames.Add(new string(item.ToCharArray()));
                    }
                }

                if (another.VariableValues != null)
                {
                    string[] items = (string[])another.VariableValues.Clone();
                    foreach (string item in items)
                    {
                        variableValues.Add(new string(item.ToCharArray()));
                    }
                }
            }
            catch (Exception e)
            {
                e.ToString();
            }

            oid = refOid;
            degree = refDegree;
            Operator = refOperator;
            fixedInd = another.FixedIndCount;
            assignedVariableCount = another.assignedVariableCount;
            variablesAssigned = another.variablesAssigned;
            index = -1;
        }