예제 #1
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();
                }
            }
예제 #2
0
 public SimpleListIterator(AbstractList <E> parent) : base()
 {
     this.parent           = parent;
     this.numLeft          = parent.Size();
     this.expectedModCount = parent.modCount;
 }