CloseableIterator<VariantContext>
, Closeable
, AutoCloseable
, Iterable<VariantContext>
, Iterator<VariantContext>
FilteringIterator
public class FilteringVariantContextIterator extends Object implements CloseableIterator<VariantContext>, Iterable<VariantContext>
Constructor | Description |
---|---|
FilteringVariantContextIterator(Iterator<VariantContext> iterator,
VariantContextFilter filter) |
Constructor of an iterator based on the provided iterator and predicate.
|
Modifier and Type | Method | 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.
|
stream, toList
forEach, spliterator
forEachRemaining
public FilteringVariantContextIterator(Iterator<VariantContext> iterator, VariantContextFilter filter)
iterator
- the backing iteratorfilter
- the filterpublic void close()
CloseableIterator
close
in interface AutoCloseable
close
in interface Closeable
close
in interface CloseableIterator<VariantContext>
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>