Пример #1
0
 /**
  * Retrieves the next element in the descending iteration.
  *
  * @return The next element in the iteration.
  * @throws ConcurrentModificationException if the expected modification count does not equal
  *     that of the underlying {@code LinkedList}.
  * @throws NoSuchElementException if the iteration has no more elements.
  */
 @Override
 public E next() {
   return iterator.previous();
 }
Пример #2
0
 /**
  * Removes from the underlying {@code LinkedList} the last element returned by this descending
  * iterator. This method can be called only once per call to {@link #next()}.
  *
  * <p>The behavior of an iterator is unspecified if the underlying collection is modified while
  * the iteration is in progress in any way other than by calling this method.
  *
  * @throws ConcurrentModificationException if the expected modification count does not equal
  *     that of the underlying {@code LinkedList}.
  * @throws IllegalStateException if the {@link #next()} method has not previously been called or
  *     the {@link #remove()} method has already been called after the last call to the {@link
  *     #next()} method.
  */
 @Override
 public void remove() {
   iterator.remove();
 }
Пример #3
0
 /**
  * Returns the previous element in this descending iteration.
  *
  * @return The previous element in this iteration.
  * @throws ConcurrentModificationException if the expected modification count does not equal
  *     that of the underlying {@code LinkedList}.
  * @throws NoSuchElementException if the iteration has no more elements.
  */
 @Override
 public boolean hasNext() {
   return iterator.hasPrevious();
 }