IN
- Input datatypeOUT
- Output datatypepublic class TypeFilterIterator<IN,OUT extends IN> extends AbstractFilteredIterator<IN,OUT> implements Iterator<OUT>
Modifier and Type | Field and Description |
---|---|
private Class<? super OUT> |
filterClass
Class restriction
|
private Iterator<IN> |
parent
Parent iterator
|
itr, nextobj
Constructor and Description |
---|
TypeFilterIterator(Class<? super OUT> filterClass,
Iterable<IN> parent)
Constructor.
|
TypeFilterIterator(Class<? super OUT> filterClass,
Iterator<IN> parent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Iterator<IN> |
getParentIterator()
Get an iterator for the actual data.
|
protected OUT |
testFilter(IN nextobj)
Test the filter predicate for a new object.
|
hasNext, init, next, remove
public TypeFilterIterator(Class<? super OUT> filterClass, Iterable<IN> parent)
filterClass
- Filterparent
- Parent collectionprotected Iterator<IN> getParentIterator()
AbstractFilteredIterator
getParentIterator
in class AbstractFilteredIterator<IN,OUT extends IN>
protected OUT testFilter(IN nextobj)
AbstractFilteredIterator
testFilter
in class AbstractFilteredIterator<IN,OUT extends IN>
nextobj
- Object to testnull
otherwise