org.apache.commons.collections.iterators
public class FilterListIterator extends ProxyListIterator
ListIterator
which
takes a Predicate
instance to filter
out objects from an underlying ListIterator
instance. Only objects for which the specified
Predicate
evaluates to true
are
returned by the iterator.Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Object o)
Not supported.
|
Predicate |
getPredicate()
Getter for the predicate property.
|
boolean |
hasNext()
Invokes the underlying
ListIterator.hasNext() method. |
boolean |
hasPrevious()
Invokes the underlying
ListIterator.hasPrevious() method. |
java.lang.Object |
next()
Invokes the underlying
ListIterator.next() method. |
int |
nextIndex()
Invokes the underlying
ListIterator.nextIndex() method. |
java.lang.Object |
previous()
Invokes the underlying
ListIterator.previous() method. |
int |
previousIndex()
Invokes the underlying
ListIterator.previousIndex() method. |
void |
remove()
Not supported.
|
void |
set(java.lang.Object o)
Not supported.
|
void |
setPredicate(Predicate predicate)
Setter for the predicate property.
|
getListIterator, setListIterator
public FilterListIterator()
FilterListIterator
that will not
function until
setListIterator
and setPredicate
are invoked.public FilterListIterator(java.util.ListIterator iterator)
FilterListIterator
that will not
function until setPredicate
is invoked.iterator
- the iterator to usepublic FilterListIterator(java.util.ListIterator iterator, Predicate predicate)
FilterListIterator
.iterator
- the iterator to usepredicate
- the predicate to usepublic FilterListIterator(Predicate predicate)
FilterListIterator
that will not
function until
setListIterator
is invoked.predicate
- the predicate to use.public void add(java.lang.Object o)
add
in interface java.util.ListIterator
add
in class ProxyListIterator
public Predicate getPredicate()
public boolean hasNext()
ProxyListIterator
ListIterator.hasNext()
method.hasNext
in interface java.util.Iterator
hasNext
in interface java.util.ListIterator
hasNext
in class ProxyListIterator
public boolean hasPrevious()
ProxyListIterator
ListIterator.hasPrevious()
method.hasPrevious
in interface java.util.ListIterator
hasPrevious
in class ProxyListIterator
public java.lang.Object next()
ProxyListIterator
ListIterator.next()
method.next
in interface java.util.Iterator
next
in interface java.util.ListIterator
next
in class ProxyListIterator
public int nextIndex()
ProxyListIterator
ListIterator.nextIndex()
method.nextIndex
in interface java.util.ListIterator
nextIndex
in class ProxyListIterator
public java.lang.Object previous()
ProxyListIterator
ListIterator.previous()
method.previous
in interface java.util.ListIterator
previous
in class ProxyListIterator
public int previousIndex()
ProxyListIterator
ListIterator.previousIndex()
method.previousIndex
in interface java.util.ListIterator
previousIndex
in class ProxyListIterator
public void remove()
remove
in interface java.util.Iterator
remove
in interface java.util.ListIterator
remove
in class ProxyListIterator
public void set(java.lang.Object o)
set
in interface java.util.ListIterator
set
in class ProxyListIterator
public void setPredicate(Predicate predicate)
predicate
- new value for the predicate property.Copyright © 2001-2004 Apache Software Foundation. Documenation generated February 26 2016.