示例#1
0
        public void add(E obj)
        {
            if (expectedModCount != outInstance.modCount)
            {
                throw new ConcurrentModificationException();
            }

            try
            {
                outInstance.add(outInstance.size() - numLeft, obj);
                expectedModCount = outInstance.modCount;
                lastPosition     = -1;
            }
            catch (java.lang.IndexOutOfBoundsException)
            {
                throw new NoSuchElementException();
            }
        }
示例#2
0
 public override void add(int location, E obj)
 {
     if (modCount == fullList.modCount)
     {
         if (0 <= location && location <= sizeJ)
         {
             fullList.add(location + offset, obj);
             sizeJ++;
             modCount = fullList.modCount;
         }
         else
         {
             throw new java.lang.IndexOutOfBoundsException();
         }
     }
     else
     {
         throw new ConcurrentModificationException();
     }
 }