Пример #1
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(AList{T}, bool)"/>
 public virtual void Prepend(AList <T> other, bool move)
 {
     Combine(other, move, false);
 }
Пример #2
0
 public void AddRange(AList <T> source)
 {
     InsertRange(Count, source);
 }
Пример #3
0
 /// <summary>Appends another AList to this list in sublinear time.</summary>
 /// <param name="other">A list of items to be added to this list.</param>
 /// <param name="move">If this parameter is true, items from the other list
 /// are transferred to this list, causing the other list to be cleared.
 /// This parameter does not affect the speed of this method itself, but
 /// if you use "true" then future modifications to the combined list may
 /// be faster. If this parameter is "false" then it will be necessary to
 /// freeze the contents of the other list so that both lists can share
 /// the same tree nodes. Using "true" instead avoids the freeze operation,
 /// which in turn avoids the performance penalty on future modifications.
 /// <remarks>
 /// The default value of the 'move' parameter is false.
 /// <para/>
 /// When the 'source' list is short, this method doesn't perform
 /// any better than a standard AddRange() operation (in fact, the operation
 /// is delegated to <see cref="InsertRange"/>()). However, when 'source'
 /// has several hundred or thousand items, the append/prepend operation is
 /// performed in roughly O(log N) time where N is the combined list size.
 /// <para/>
 /// Parts of the tree that end up shared between this list and the other
 /// list will be frozen. Frozen parts of the tree must be cloned in order
 /// to be modified, which will slow down future operations on the tree.
 /// In order to avoid this problem, use move semantics (which clears the
 /// other list).
 /// </remarks>
 public virtual void Append(AList <T> other, bool move)
 {
     Combine(other, move, true);
 }
Пример #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(AList{T}, bool)"/>
 public virtual void Prepend(AList <T> other)
 {
     Combine(other, false, false);
 }
Пример #5
0
 /// <inheritdoc cref="Append(AList{T}, bool)"/>
 public virtual void Append(AList <T> other)
 {
     Combine(other, false, true);
 }
Пример #6
0
 /// <summary>Swaps the contents of two <see cref="AList{T}"/>s in O(1) time.</summary>
 /// <remarks>Any observers are also swapped.</remarks>
 public void Swap(AList <T> other)
 {
     base.SwapHelper(other, true);
 }
Пример #7
0
 public void InsertRange(int index, AList <T> source, bool move)
 {
     base.InsertRange(index, source, move);
 }
Пример #8
0
 public void InsertRange(int index, AList <T> source)
 {
     InsertRange(index, source, false);
 }
Пример #9
0
 public AList(AList <T> items, bool keepListChangingHandlers) : base(items, keepListChangingHandlers)
 {
 }