public class FilteringVariantContextIterator extends Object implements CloseableIterator<VariantContext>, Iterable<VariantContext>
Constructor and Description |
---|
FilteringVariantContextIterator(Iterator<VariantContext> iterator,
VariantContextFilter filter)
Constructor of an iterator based on the provided iterator and predicate.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Should be implemented to close/release any underlying resources.
|
boolean |
hasNext()
Returns true if the iteration has more elements.
|
Iterator<VariantContext> |
iterator()
function to satisfy the Iterable interface
|
VariantContext |
next()
Returns the next element in the iteration.
|
void |
remove()
Required method for Iterator API.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
stream, toList
forEachRemaining
forEach, spliterator
public FilteringVariantContextIterator(Iterator<VariantContext> iterator, VariantContextFilter filter)
iterator
- the backing iteratorfilter
- the filterpublic void close()
CloseableIterator
close
in interface CloseableIterator<VariantContext>
close
in interface Closeable
close
in interface AutoCloseable
public boolean hasNext()
hasNext
in interface Iterator<VariantContext>
public VariantContext next() throws NoSuchElementException
next
in interface Iterator<VariantContext>
NoSuchElementException
- if there are no more elements to returnpublic void remove()
remove
in interface Iterator<VariantContext>
UnsupportedOperationException
- since it is unsupported here.public Iterator<VariantContext> iterator()
iterator
in interface Iterable<VariantContext>