gausssoft.collections
Class FilterListIterator

java.lang.Object
  |
  +--gausssoft.collections.FilterListIterator
All Implemented Interfaces:
Iterator, ListIterator, Serializable

public class FilterListIterator
extends Object
implements ListIterator, Serializable

The FilterListIterator class contains another ListIterator, which it uses as it's basic source of data, possibly transforming the data along the way or providing additional functionality.

Each method in this implementation calls the method with the same signature in the backing list iterator.

This class can only be serialized if the backing list iterator is serializable.

Author:
Allan Crooks
See Also:
ListIterator, Serialized Form

Field Summary
protected  ListIterator root
          The backing list iterator.
 
Constructor Summary
FilterListIterator(ListIterator root)
          Creates a new FilterListIterator.
 
Method Summary
 void add(Object o)
           
 boolean hasNext()
           
 boolean hasPrevious()
           
 Object next()
           
 int nextIndex()
           
 Object previous()
           
 int previousIndex()
           
 void remove()
           
 void set(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

protected ListIterator root
The backing list iterator.
Constructor Detail

FilterListIterator

public FilterListIterator(ListIterator root)
Creates a new FilterListIterator.
Parameters:
root - The list iterator to wrap this FilterListIterator around.
Throws:
NullPointerException - root is null.
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface ListIterator

next

public Object next()
Specified by:
next in interface ListIterator

remove

public void remove()
Specified by:
remove in interface ListIterator

hasPrevious

public boolean hasPrevious()
Specified by:
hasPrevious in interface ListIterator

previous

public Object previous()
Specified by:
previous in interface ListIterator

nextIndex

public int nextIndex()
Specified by:
nextIndex in interface ListIterator

previousIndex

public int previousIndex()
Specified by:
previousIndex in interface ListIterator

set

public void set(Object o)
Specified by:
set in interface ListIterator

add

public void add(Object o)
Specified by:
add in interface ListIterator