Exemplo n.º 1
0
        public new SparseAList <T> RemoveSection(int start, int count)
        {
            if ((uint)count > _count - (uint)start)
            {
                throw new ArgumentOutOfRangeException(count < 0 ? "count" : "start+count");
            }

            var newList = new SparseAList <T>(this, CopySectionHelper(start, count));

            // bug fix: we must RemoveRange after creating the new list, because
            // the section is expected to have the same height as the original tree
            // during the constructor of the new list.
            RemoveRange(start, count);
            return(newList);
        }
Exemplo n.º 2
0
 public SparseAList(SparseAList <T> items, bool keepListChangingHandlers) : base(items, keepListChangingHandlers)
 {
 }
Exemplo n.º 3
0
 /// <summary>Prepends an AList to this list in sublinear time.</summary>
 /// <param name="other">A list of items to be added to the front of this list (at index 0).</param>
 /// <inheritdoc cref="Append(SparseAList{T}, bool)"/>
 public virtual void Prepend(SparseAList <T> other, bool move)
 {
     Combine(other, move, false);
 }
Exemplo n.º 4
0
 /// <summary>Prepends an AList to this list in sublinear time.</summary>
 /// <param name="other">A list of items to be added to the front of this list (at index 0).</param>
 /// <inheritdoc cref="Append(SparseAList{T}, bool)"/>
 public virtual void Prepend(SparseAList <T> other)
 {
     Combine(other, false, false);
 }
Exemplo n.º 5
0
 /// <inheritdoc cref="AList{T}.Append(AList{T}, bool)"/>
 public virtual void Append(SparseAList <T> other, bool move)
 {
     Combine(other, move, true);
 }
Exemplo n.º 6
0
 /// <inheritdoc cref="AList{T}.Append(AList{T}, bool)"/>
 public virtual void Append(SparseAList <T> other)
 {
     Combine(other, false, true);
 }
Exemplo n.º 7
0
 /// <summary>Swaps the contents of two <see cref="SparseAList{T}"/>s in O(1) time.</summary>
 /// <remarks>Any observers are also swapped.</remarks>
 public void Swap(SparseAList <T> other)
 {
     base.SwapHelper(other, true);
 }
Exemplo n.º 8
0
 public void InsertRange(int index, SparseAList <T> source, bool move)
 {
     base.InsertRange(index, source, move);
 }
Exemplo n.º 9
0
 public void InsertRange(int index, SparseAList <T> source)
 {
     InsertRange(index, source, false);
 }