public class FilteringVariantContextIterator extends java.lang.Object implements CloseableIterator<VariantContext>, java.lang.Iterable<VariantContext>
Constructor and Description |
---|
FilteringVariantContextIterator(java.util.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.
|
java.util.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
public FilteringVariantContextIterator(java.util.Iterator<VariantContext> iterator, VariantContextFilter filter)
iterator
- the backing iteratorfilter
- the filterpublic void close()
CloseableIterator
close
in interface CloseableIterator<VariantContext>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean hasNext()
hasNext
in interface java.util.Iterator<VariantContext>
public VariantContext next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator<VariantContext>
java.util.NoSuchElementException
- if there are no more elements to returnpublic void remove()
remove
in interface java.util.Iterator<VariantContext>
java.lang.UnsupportedOperationException
- since it is unsupported here.public java.util.Iterator<VariantContext> iterator()
iterator
in interface java.lang.Iterable<VariantContext>