## org.apache.commons.collections.iterators
Class FilterListIterator

    java.lang.Object
      org.apache.commons.collections.iterators.FilterListIterator

All Implemented Interfaces:
  java.util.Iterator, java.util.ListIterator

    public class FilterListIterator

extends java.lang.Object
implements java.util.ListIterator

Decorates another `ListIterator` using a predicate to filter elements.

This iterator decorates the underlying iterator, only allowing through those elements that match the specified `Predicate`.

Since:
  Commons Collections 2.0
Version:
  $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $
Author:
  Rodney Waldhoff

Constructor Summary
`FilterListIterator()` Constructs a new `FilterListIterator` that will not function until `setListIterator` and `setPredicate` are invoked.
`FilterListIterator(java.util.ListIterator iterator)` Constructs a new `FilterListIterator` that will not function until `setPredicate` is invoked.
`FilterListIterator(java.util.ListIterator iterator, Predicate predicate)` Constructs a new `FilterListIterator`.
`FilterListIterator(Predicate predicate)` Constructs a new `FilterListIterator` that will not function until `setListIterator` is invoked.

Method Summary
`void` `add(java.lang.Object o)` Not supported.
`java.util.ListIterator` `getListIterator()` Gets the iterator this iterator is using.
`Predicate` `getPredicate()` Gets the predicate this iterator is using.
`boolean` `hasNext()`
`boolean` `hasPrevious()`
`java.lang.Object` `next()`
`int` `nextIndex()`
`java.lang.Object` `previous()`
`int` `previousIndex()`
`void` `remove()` Not supported.
`void` `set(java.lang.Object o)` Not supported.
`void` `setListIterator(java.util.ListIterator iterator)` Sets the iterator for this iterator to use.
`void` `setPredicate(Predicate predicate)` Sets the predicate this the iterator to use.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### FilterListIterator

    public FilterListIterator()

  Constructs a new `FilterListIterator` that will not function until `setListIterator` and `setPredicate` are invoked.

### FilterListIterator

    public FilterListIterator(java.util.ListIterator iterator)

  Constructs a new `FilterListIterator` that will not function until `setPredicate` is invoked.

  Parameters:
    `iterator` - the iterator to use

### FilterListIterator

    public FilterListIterator(java.util.ListIterator iterator,
                              Predicate predicate)

  Constructs a new `FilterListIterator`.

  Parameters:
    `iterator` - the iterator to use
    `predicate` - the predicate to use

### FilterListIterator

    public FilterListIterator(Predicate predicate)

  Constructs a new `FilterListIterator` that will not function until `setListIterator` is invoked.

  Parameters:
    `predicate` - the predicate to use.

Method Detail

### add

    public void add(java.lang.Object o)

  Not supported.

  Specified by:
    `add` in interface `java.util.ListIterator`

### hasNext

    public boolean hasNext()

  Specified by:
    `hasNext` in interface `java.util.Iterator`
  Specified by:
    `hasNext` in interface `java.util.ListIterator`

### hasPrevious

    public boolean hasPrevious()

  Specified by:
    `hasPrevious` in interface `java.util.ListIterator`

### next

    public java.lang.Object next()

  Specified by:
    `next` in interface `java.util.Iterator`
  Specified by:
    `next` in interface `java.util.ListIterator`

### nextIndex

    public int nextIndex()

  Specified by:
    `nextIndex` in interface `java.util.ListIterator`

### previous

    public java.lang.Object previous()

  Specified by:
    `previous` in interface `java.util.ListIterator`

### previousIndex

    public int previousIndex()

  Specified by:
    `previousIndex` in interface `java.util.ListIterator`

### remove

    public void remove()

  Not supported.

  Specified by:
    `remove` in interface `java.util.Iterator`
  Specified by:
    `remove` in interface `java.util.ListIterator`

### set

    public void set(java.lang.Object o)

  Not supported.

  Specified by:
    `set` in interface `java.util.ListIterator`

### getListIterator

    public java.util.ListIterator getListIterator()

  Gets the iterator this iterator is using.

  Returns:
    the iterator.

### setListIterator

    public void setListIterator(java.util.ListIterator iterator)

  Sets the iterator for this iterator to use. If iteration has started, this effectively resets the iterator.

  Parameters:
    `iterator` - the iterator to use

### getPredicate

    public Predicate getPredicate()

  Gets the predicate this iterator is using.

  Returns:
    the predicate.

### setPredicate

    public void setPredicate(Predicate predicate)

  Sets the predicate this the iterator to use.

  Parameters:
    `predicate` - the transformer to use

Copyright © 2001-2008 The Apache Software Foundation. All Rights Reserved.