Class FilterListIterator<E>
java.lang.Object
org.apache.commons.collections4.iterators.FilterListIterator<E>
- Type Parameters:
- E- the type of elements returned by this iterator.
- All Implemented Interfaces:
- Iterator<E>,- ListIterator<E>
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:
- 2.0
- 
Constructor SummaryConstructorsConstructorDescriptionConstructs a newFilterListIteratorthat will not function untilsetListIteratorandsetPredicateare invoked.FilterListIterator(ListIterator<? extends E> iterator) Constructs a newFilterListIteratorthat will not function untilsetPredicateis invoked.FilterListIterator(ListIterator<? extends E> iterator, Predicate<? super E> predicate) Constructs a newFilterListIterator.FilterListIterator(Predicate<? super E> predicate) Constructs a newFilterListIteratorthat will not function untilsetListIteratoris invoked.
- 
Method SummaryModifier and TypeMethodDescriptionvoidNot supported.ListIterator<? extends E> Gets the iterator this iterator is using.Gets the predicate this iterator is using.booleanhasNext()booleannext()intprevious()intvoidremove()Not supported.voidNot supported.voidsetListIterator(ListIterator<? extends E> iterator) Sets the iterator for this iterator to use.voidsetPredicate(Predicate<? super E> predicate) Sets the predicate this the iterator to use.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.IteratorforEachRemaining
- 
Constructor Details- 
FilterListIteratorpublic FilterListIterator()Constructs a newFilterListIteratorthat will not function untilsetListIteratorandsetPredicateare invoked.
- 
FilterListIteratorConstructs a newFilterListIteratorthat will not function untilsetPredicateis invoked.- Parameters:
- iterator- the iterator to use
 
- 
FilterListIteratorConstructs a newFilterListIterator.- Parameters:
- iterator- the iterator to use
- predicate- the predicate to use
 
- 
FilterListIteratorConstructs a newFilterListIteratorthat will not function untilsetListIteratoris invoked.- Parameters:
- predicate- the predicate to use.
 
 
- 
- 
Method Details- 
addNot supported.- Specified by:
- addin interface- ListIterator<E>
- Parameters:
- o- the element to insert
 
- 
getListIteratorGets the iterator this iterator is using.- Returns:
- the iterator.
 
- 
getPredicateGets the predicate this iterator is using.- Returns:
- the predicate.
 
- 
hasNext
- 
hasPrevious- Specified by:
- hasPreviousin interface- ListIterator<E>
 
- 
next
- 
nextIndex- Specified by:
- nextIndexin interface- ListIterator<E>
 
- 
previous- Specified by:
- previousin interface- ListIterator<E>
 
- 
previousIndex- Specified by:
- previousIndexin interface- ListIterator<E>
 
- 
remove
- 
setNot supported.- Specified by:
- setin interface- ListIterator<E>
- Parameters:
- ignored- the element with which to replace the last element returned by- nextor- previous
 
- 
setListIteratorSets the iterator for this iterator to use. If iteration has started, this effectively resets the iterator.- Parameters:
- iterator- the iterator to use
 
- 
setPredicateSets the predicate this the iterator to use.- Parameters:
- predicate- the transformer to use
 
 
-