public class

ProxyIterator

extends Object
implements Iterator<E>
java.lang.Object
   ↳ org.apache.commons.collections.iterators.ProxyIterator

This class is deprecated.
Use AbstractIteratorDecorator. Will be removed in v4.0

Class Overview

A Proxy Iterator Iterator which delegates its methods to a proxy instance.

Summary

Public Constructors
ProxyIterator()
Constructs a new ProxyIterator that will not function until setIterator(Iterator) is called.
ProxyIterator(Iterator iterator)
Constructs a new ProxyIterator that will use the given iterator.
Public Methods
Iterator getIterator()
Getter for property iterator.
boolean hasNext()
Returns true if the underlying iterator has more elements.
Object next()
Returns the next element from the underlying iterator.
void remove()
Removes the last returned element from the collection that spawned the underlying iterator.
void setIterator(Iterator iterator)
Setter for property iterator.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Iterator

Public Constructors

public ProxyIterator ()

Constructs a new ProxyIterator that will not function until setIterator(Iterator) is called.

public ProxyIterator (Iterator iterator)

Constructs a new ProxyIterator that will use the given iterator.

Parameters
iterator the underlying iterator

Public Methods

public Iterator getIterator ()

Getter for property iterator.

Returns
  • Value of property iterator.

public boolean hasNext ()

Returns true if the underlying iterator has more elements.

Returns
  • true if the underlying iterator has more elements

public Object next ()

Returns the next element from the underlying iterator.

Returns
  • the next element from the underlying iterator
Throws
NoSuchElementException if the underlying iterator raises it because it has no more elements

public void remove ()

Removes the last returned element from the collection that spawned the underlying iterator.

public void setIterator (Iterator iterator)

Setter for property iterator.

Parameters
iterator New value of property iterator.