public class

FilterListIterator

extends Object
implements ListIterator<E>
java.lang.Object
   ↳ org.apache.commons.collections.iterators.FilterListIterator

Class Overview

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.

Summary

Public Constructors
FilterListIterator()
Constructs a new FilterListIterator that will not function until setListIterator and setPredicate are invoked.
FilterListIterator(ListIterator iterator)
Constructs a new FilterListIterator that will not function until setPredicate is invoked.
FilterListIterator(ListIterator iterator, Predicate predicate)
Constructs a new FilterListIterator.
FilterListIterator(Predicate predicate)
Constructs a new FilterListIterator that will not function until setListIterator is invoked.
Public Methods
void add(Object o)
Not supported.
ListIterator getListIterator()
Gets the iterator this iterator is using.
Predicate getPredicate()
Gets the predicate this iterator is using.
boolean hasNext()
boolean hasPrevious()
Object next()
int nextIndex()
Object previous()
int previousIndex()
void remove()
Not supported.
void set(Object o)
Not supported.
void setListIterator(ListIterator iterator)
Sets the iterator for this iterator to use.
void setPredicate(Predicate predicate)
Sets the predicate this the iterator to use.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Iterator
From interface java.util.ListIterator

Public Constructors

public FilterListIterator ()

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

public FilterListIterator (ListIterator iterator)

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

Parameters
iterator the iterator to use

public FilterListIterator (ListIterator iterator, Predicate predicate)

Constructs a new FilterListIterator.

Parameters
iterator the iterator to use
predicate the predicate to use

public FilterListIterator (Predicate predicate)

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

Parameters
predicate the predicate to use.

Public Methods

public void add (Object o)

Not supported.

public ListIterator getListIterator ()

Gets the iterator this iterator is using.

Returns
  • the iterator.

public Predicate getPredicate ()

Gets the predicate this iterator is using.

Returns
  • the predicate.

public boolean hasNext ()

public boolean hasPrevious ()

public Object next ()

public int nextIndex ()

public Object previous ()

public int previousIndex ()

public void remove ()

Not supported.

public void set (Object o)

Not supported.

public void setListIterator (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

public void setPredicate (Predicate predicate)

Sets the predicate this the iterator to use.

Parameters
predicate the transformer to use