|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.collections.FilteredIterator<E>
umontreal.iro.lecuyer.collections.FilteredListIterator<E>
E
- the type of the accepted objects.public abstract class FilteredListIterator<E>
Represents a list iterator traversing a restricted
subset of the elements enumerated by another list iterator.
A filtered list iterator encapsulates an
ordinary list iterator, and uses it to
enumerate objects.
However, this iterator only returns objects passing
the test implemented in the user-defined FilteredIterator.filter(java.lang.Object)
method.
For example, this class could be used to
iterate over objects of a
certain subclass or having certain properties.
Note that this iterator does not support
the add(E)
, set(E)
, and remove()
operations.
Constructor Summary | |
---|---|
FilteredListIterator(ListIterator<? super E> it)
Constructs a new filtered iterator from the iterator it. |
|
FilteredListIterator(ListIterator<? super E> it,
int maxNumElements)
Constructs a new filtered iterator from the iterator it, and returning at most maxNumElements elements. |
Method Summary | |
---|---|
void |
add(E o)
|
ListIterator<? super E> |
getInnerIterator()
Returns the inner iterator used by this iterator. |
boolean |
hasNext()
|
boolean |
hasPrevious()
|
E |
next()
|
int |
nextIndex()
|
E |
previous()
|
int |
previousIndex()
|
void |
remove()
|
void |
set(E o)
|
Methods inherited from class umontreal.iro.lecuyer.collections.FilteredIterator |
---|
filter, getMaxNumElements |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FilteredListIterator(ListIterator<? super E> it)
nextIndex()
.
it
- the iterator being filtered.
NullPointerException
- if it is null.public FilteredListIterator(ListIterator<? super E> it, int maxNumElements)
nextIndex()
, which
cannot exceed maxNumElements.
it
- the iterator being filtered.maxNumElements
- the maximal number of elements the iterator can return.
NullPointerException
- if it is null.
IllegalArgumentException
- if maxNumElements is negative.Method Detail |
---|
public ListIterator<? super E> getInnerIterator()
getInnerIterator
in class FilteredIterator<E>
public void add(E o)
add
in interface ListIterator<E>
public boolean hasNext()
hasNext
in interface Iterator<E>
hasNext
in interface ListIterator<E>
hasNext
in class FilteredIterator<E>
public boolean hasPrevious()
hasPrevious
in interface ListIterator<E>
public int nextIndex()
nextIndex
in interface ListIterator<E>
public E previous()
previous
in interface ListIterator<E>
public E next()
next
in interface Iterator<E>
next
in interface ListIterator<E>
next
in class FilteredIterator<E>
public int previousIndex()
previousIndex
in interface ListIterator<E>
public void set(E o)
set
in interface ListIterator<E>
public void remove()
remove
in interface Iterator<E>
remove
in interface ListIterator<E>
remove
in class FilteredIterator<E>
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |