Example #1
0
 public SparseAListLeaf(SparseAListLeaf <T> original)
 {
     _list        = original._list.Clone();
     _maxNodeSize = original._maxNodeSize;
     _totalCount  = original._totalCount;
     _isFrozen    = false;
 }
Example #2
0
 static void AdjustOffsetsStartingAt(int i, ref InternalDList <Entry> list, int change)
 {
     for (; i < list.Count; i++)
     {
         list.InternalArray[list.Internalize(i)].Offset += (uint)change;
     }
 }
Example #3
0
 private SparseAListLeaf(ushort maxNodeSize, InternalDList <Entry> list, uint totalCount)
 {
     Debug.Assert(maxNodeSize >= 3);
     _maxNodeSize = maxNodeSize;
     _list        = list;
     _totalCount  = totalCount;
 }
Example #4
0
        public InternalDList <T> Clone()
        {
            InternalDList <T> clone = new InternalDList <T>();

            clone._array = new T[Count];
            CopyTo(clone._array, 0);
            clone._start = 0;
            clone._count = Count;
            return(clone);
        }
Example #5
0
        public override AListNode <int, T> CopySection(uint index, uint count, AListBase <int, T> list)
        {
            int i1, i2;

            i1 = GetSectionRange(index, count, out i2);

            InternalDList <Entry> section = _list.CopySection(i1, i2 - i1);

            AdjustOffsetsStartingAt(0, ref section, -(int)index);
            return(new SparseAListLeaf <T>(_maxNodeSize, section, count));
        }
Example #6
0
 internal Enumerator(InternalDList <T> list, DList <T> wrapper)
 {
     size1        = list.FirstHalfSize;
     i            = list._start;
     stop         = i + size1;
     stop2        = list._count - size1;
     array        = list._array;
     wrapper      = wrapper ?? NoWrapper;
     this.wrapper = wrapper;
     oldCount     = wrapper.Count;
 }
Example #7
0
 internal static void RemovingItems <K, T>(this IAListTreeObserver <K, T> self, InternalDList <T> list, int index, int count, AListLeaf <K, T> parent, bool isMoving)
 {
     for (int i = index; i < index + count; i++)
     {
         self.ItemRemoved(list[i], parent);
     }
 }
Example #8
0
 protected BListLeaf(ushort maxNodeSize, InternalDList <T> list) : base(maxNodeSize, list)
 {
 }
Example #9
0
 public AListLeaf(AListLeaf <K, T> original)
 {
     _list        = original._list.Clone();
     _maxNodeSize = original._maxNodeSize;
     _isFrozen    = false;
 }
Example #10
0
 protected AListLeaf(ushort maxNodeSize, InternalDList <T> list) : this(maxNodeSize)
 {
     _list = list;
 }