public class FilterListIterator extends Object implements ListIterator
ListIterator
using a predicate to filter elements.
This iterator decorates the underlying iterator, only allowing through
those elements that match the specified Predicate
.
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
public FilterListIterator()
FilterListIterator
that will not function
until setListIterator
and setPredicate
are invoked.public FilterListIterator(ListIterator iterator)
FilterListIterator
that will not
function until setPredicate
is invoked.iterator
- the iterator to usepublic FilterListIterator(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(Object o)
add
in interface ListIterator
public boolean hasNext()
hasNext
in interface Iterator
hasNext
in interface ListIterator
public boolean hasPrevious()
hasPrevious
in interface ListIterator
public Object next()
next
in interface Iterator
next
in interface ListIterator
public int nextIndex()
nextIndex
in interface ListIterator
public Object previous()
previous
in interface ListIterator
public int previousIndex()
previousIndex
in interface ListIterator
public void remove()
remove
in interface Iterator
remove
in interface ListIterator
public void set(Object o)
set
in interface ListIterator
public ListIterator getListIterator()
public void setListIterator(ListIterator iterator)
iterator
- the iterator to usepublic Predicate getPredicate()
public void setPredicate(Predicate predicate)
predicate
- the transformer to useCopyright © 2001–2015 The Apache Software Foundation. All rights reserved.