Package org.biojavax.bio.seq.io
Class HashedFastaIterator
- java.lang.Object
-
- org.biojavax.bio.seq.io.HashedFastaIterator
-
- All Implemented Interfaces:
SequenceIterator,BioEntryIterator,RichSequenceIterator
public class HashedFastaIterator extends Object implements RichSequenceIterator
Iterates over a Fasta file that is kept in memory for optimized access.- Since:
- 1.7
- Author:
- Andreas Prlic
-
-
Constructor Summary
Constructors Constructor Description HashedFastaIterator(BufferedInputStream is, Alphabet alpha, Namespace ns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()Returns whether there are more sequences to iterate over.BioEntrynextBioEntry()RichSequencenextRichSequence()SequencenextSequence()Returns the next sequence in the iterator.
-
-
-
Constructor Detail
-
HashedFastaIterator
public HashedFastaIterator(BufferedInputStream is, Alphabet alpha, Namespace ns) throws BioException
- Throws:
BioException
-
-
Method Detail
-
nextRichSequence
public RichSequence nextRichSequence() throws NoSuchElementException, BioException
- Specified by:
nextRichSequencein interfaceRichSequenceIterator- Throws:
NoSuchElementExceptionBioException
-
hasNext
public boolean hasNext()
Description copied from interface:BioEntryIteratorReturns whether there are more sequences to iterate over.- Specified by:
hasNextin interfaceBioEntryIterator- Specified by:
hasNextin interfaceSequenceIterator- Returns:
- true if there are more sequences to get and false otherwise
-
nextBioEntry
public BioEntry nextBioEntry() throws NoSuchElementException, BioException
- Specified by:
nextBioEntryin interfaceBioEntryIterator- Throws:
NoSuchElementExceptionBioException
-
nextSequence
public Sequence nextSequence() throws NoSuchElementException, BioException
Description copied from interface:SequenceIteratorReturns the next sequence in the iterator.- Specified by:
nextSequencein interfaceSequenceIterator- Returns:
- the next Sequence
- Throws:
NoSuchElementException- if you call nextSequence when hasNext returns falseBioException- if for any reason the sequence could not be retrieved
-
-