org.biojava.bio.seq
Interface SequenceIterator
- All Known Implementing Classes:
- StreamReader, SequenceIteratorAdapter
- public interface SequenceIterator
An iterator over a bag of sequences.
java.util.iterator was not apropreate here, as we need specific exceptions
to be thrown, and as much type-saftey as possible. However, we have made it
as complient with iterator as we could so that there is a minimal learning
curve.
- Author:
- Matthew Pocock
Method Summary |
boolean |
hasNext()
Returns whether there are more sequences to iterate over. |
Sequence |
nextSequence()
Returns the next sequence in the iterator. |
hasNext
public boolean hasNext()
- Returns whether there are more sequences to iterate over.
- Returns:
- true if there are more sequences to get and false otherwise
nextSequence
public Sequence nextSequence()
throws java.util.NoSuchElementException,
BioException
- Returns the next sequence in the iterator.
- Returns:
- the next Sequence
- Throws:
- java.util.NoSuchElementException - if you call nextSequence when hasNext
returns false
- BioException - if for any reason the sequence could not be retrieved