Example #1
0
 public void PushAllFrom(InterfaceFastList <V> list)
 {
     while (true)
     {
         IListElem <V> firstElem = list.PopFirst();
         if (firstElem == null)
         {
             return;
         }
         PushLast(firstElem);
     }
 }
Example #2
0
        public static void InsertOrdered <T>(InterfaceFastList <T> list, IListElem <T> elemToInsert) where T : IComparable <T>
        {
            T             value   = elemToInsert.ElemValue;
            IListElem <T> pointer = list.First;

            while (pointer != null)
            {
                T existingDefEntry = pointer.ElemValue;
                if (existingDefEntry.CompareTo(value) < 0)
                {
                    // DefEntry is of higher priority
                    list.InsertBefore(elemToInsert, pointer);
                    return;
                }
                pointer = pointer.Next;
            }
            // DefEntry is of the least priority
            list.PushLast(elemToInsert);
        }
Example #3
0
 public MapLinkedIterator(AbstractLinkedMap <E, K, V> hashMap, InterfaceFastList <E> fastIterationList, bool removeAllowed)
     : base(removeAllowed)
 {
     this.hashMap           = hashMap;
     this.fastIterationList = fastIterationList;
 }
Example #4
0
 public SetLinkedIterator(AbstractLinkedSet <E, K> hashSet, InterfaceFastList <E> fastIterationList, bool removeAllowed)
     : base(removeAllowed)
 {
     this.hashSet           = hashSet;
     this.fastIterationList = fastIterationList;
 }