Пример #1
0
        /// <summary>
        /// Adds the specified arg.
        /// </summary>
        /// <param name="arg">The arg.</param>
        public void Add(KeyValuePair <IInterval <T>, TypeValue> arg)
        {
            bool wasAdded      = false;
            bool wasSuccessful = false;

            this.Root = IntervalNode.Add(this.Root, arg, ref wasAdded, ref wasSuccessful);
            IntervalNode.ComputeMax(this.Root);
        }
Пример #2
0
        /// <summary>
        /// Deletes the interval starting at x.
        /// </summary>
        /// <param name="arg">The arg.</param>
        public void Delete(IInterval <T> arg)
        {
            if (Root != null)
            {
                bool wasDeleted    = false;
                bool wasSuccessful = false;

                Root = IntervalNode.Delete(Root, arg, ref wasDeleted, ref wasSuccessful);
                if (this.Root != null)
                {
                    IntervalNode.ComputeMax(this.Root);
                }
            }
        }