org.apache.commons.collections.iterators

Class ProxyListIterator

public class ProxyListIterator extends Object implements ListIterator

Deprecated: Use AbstractListIteratorDecorator. Will be removed in v4.0

A proxy {@link ListIterator ListIterator} which delegates its methods to a proxy instance.

Since: Commons Collections 2.0

Version: $Revision: 1.9 $ $Date: 2004/02/18 00:59:50 $

Author: Rodney Waldhoff

Constructor Summary
ProxyListIterator()
Constructs a new ProxyListIterator that will not function until {@link #setListIterator(ListIterator) setListIterator} is invoked.
ProxyListIterator(ListIterator iterator)
Constructs a new ProxyListIterator that will use the given list iterator.
Method Summary
voidadd(Object o)
Invokes the underlying {@link ListIterator#add(Object)} method.
ListIteratorgetListIterator()
Getter for property iterator.
booleanhasNext()
Invokes the underlying {@link ListIterator#hasNext()} method.
booleanhasPrevious()
Invokes the underlying {@link ListIterator#hasPrevious()} method.
Objectnext()
Invokes the underlying {@link ListIterator#next()} method.
intnextIndex()
Invokes the underlying {@link ListIterator#nextIndex()} method.
Objectprevious()
Invokes the underlying {@link ListIterator#previous()} method.
intpreviousIndex()
Invokes the underlying {@link ListIterator#previousIndex()} method.
voidremove()
Invokes the underlying {@link ListIterator#remove()} method.
voidset(Object o)
Invokes the underlying {@link ListIterator#set(Object)} method.
voidsetListIterator(ListIterator iterator)
Setter for property iterator.

Constructor Detail

ProxyListIterator

public ProxyListIterator()
Constructs a new ProxyListIterator that will not function until {@link #setListIterator(ListIterator) setListIterator} is invoked.

ProxyListIterator

public ProxyListIterator(ListIterator iterator)
Constructs a new ProxyListIterator that will use the given list iterator.

Parameters: iterator the list iterator to use

Method Detail

add

public void add(Object o)
Invokes the underlying {@link ListIterator#add(Object)} method.

Throws: NullPointerException if the underlying iterator is null

getListIterator

public ListIterator getListIterator()
Getter for property iterator.

Returns: Value of property iterator.

hasNext

public boolean hasNext()
Invokes the underlying {@link ListIterator#hasNext()} method.

Throws: NullPointerException if the underlying iterator is null

hasPrevious

public boolean hasPrevious()
Invokes the underlying {@link ListIterator#hasPrevious()} method.

Throws: NullPointerException if the underlying iterator is null

next

public Object next()
Invokes the underlying {@link ListIterator#next()} method.

Throws: NullPointerException if the underlying iterator is null

nextIndex

public int nextIndex()
Invokes the underlying {@link ListIterator#nextIndex()} method.

Throws: NullPointerException if the underlying iterator is null

previous

public Object previous()
Invokes the underlying {@link ListIterator#previous()} method.

Throws: NullPointerException if the underlying iterator is null

previousIndex

public int previousIndex()
Invokes the underlying {@link ListIterator#previousIndex()} method.

Throws: NullPointerException if the underlying iterator is null

remove

public void remove()
Invokes the underlying {@link ListIterator#remove()} method.

Throws: NullPointerException if the underlying iterator is null

set

public void set(Object o)
Invokes the underlying {@link ListIterator#set(Object)} method.

Throws: NullPointerException if the underlying iterator is null

setListIterator

public void setListIterator(ListIterator iterator)
Setter for property iterator.

Parameters: iterator New value of property iterator.

Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.