Exemplo n.º 1
0
 public override E Get(int location)
 {
     if (modCount == fullList.modCount)
     {
         if (0 <= location && location < size)
         {
             return(fullList.Get(location + offset));
         }
         throw new IndexOutOfRangeException();
     }
     throw new ConcurrentModificationException();
 }
Exemplo n.º 2
0
            public E Next()
            {
                if (expectedModCount != parent.modCount)
                {
                    throw new ConcurrentModificationException();
                }

                try
                {
                    int index  = parent.Size() - numLeft;
                    E   result = parent.Get(index);
                    lastPosition = index;
                    numLeft--;
                    return(result);
                }
                catch (IndexOutOfRangeException)
                {
                    throw new NoSuchElementException();
                }
            }