Exemple #1
0
        /// <summary>
        /// Entrypoint into the algorithm this class is all about. This method triggers that the
        /// differences between A and B are calculated in form of a list of edits.
        /// </summary>
        protected void calculateEdits()
        {
            edits = new EditList();

            middle.initialize(0, a.size(), 0, b.size());
            if (middle.beginA >= middle.endA &&
                middle.beginB >= middle.endB)
            {
                return;
            }

            calculateEdits(middle.beginA, middle.endA,
                           middle.beginB, middle.endB);
        }
Exemple #2
0
        private bool isEqual(EditList o)
        {
            if (Count != o.Count)
            {
                return(false);
            }

            for (int i = 0; i < Count; i++)
            {
                if (!this[i].Equals(o[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemple #3
0
        public override bool Equals(object obj)
        {
            EditList e = (obj as EditList);

            if (e != null)
            {
                return(isEqual(e));
            }

            string s = (obj as string);

            if (s != null)
            {
                return(isEqual(s));
            }

            return(false);
        }