Groovy Documentation

## org.codehaus.groovy.runtime
[Java] Class ReverseListIterator

    java.lang.Object
      org.codehaus.groovy.runtime.ReverseListIterator

All Implemented Interfaces:
  java.util.Iterator

    public class ReverseListIterator
    extends java.lang.Object

A reverse iterator over a list. Utilizes the java.util.ListIterator obtained from the provided java.util.List and converts it to an java.util.Iterator that efficiently traverses the `List` in reverse. The fail-fast semantics of this iterator are the same as the semantics of the underlying `ListIterator`.

Authors:
  Mike Dillon

Constructor Summary
`ReverseListIterator(java.util.List list)` Constructs a new `ReverseListIterator` for the provided list.

Method Summary
`boolean` | `hasNext()` {@inheritDoc}
`java.lang.Object` | `next()` {@inheritDoc}
`void` | `remove()` {@inheritDoc}

Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()

Constructor Detail

### ReverseListIterator

    public ReverseListIterator(java.util.List list)

  Constructs a new `ReverseListIterator` for the provided list.
  Parameters:
    `list` - the list to iterate over in reverse

Method Detail

### hasNext

    public boolean hasNext()

  {@inheritDoc}

### next

    public java.lang.Object next()

  {@inheritDoc}

### remove

    public void remove()

  {@inheritDoc}

Groovy Documentation