public class FastaProteinReader extends Object implements IterativeReader<Protein>
UniprotFastaHeaderParser for an example.EMPTY_READER| Constructor and Description |
|---|
FastaProteinReader(File file)
Constructs a FastaReader that reads from a file.
|
FastaProteinReader(Reader reader)
Construct a FastaReader that reads from a Reader
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeaderParser(FastaHeaderParser parser)
Add a header parser
|
void |
close()
Closes the reader and releases any system resources associated with
it.
|
boolean |
hasNext()
Returns
true if the reader has more elements. |
Protein |
next()
Returns the next element in the reader.
|
protected void |
parseHeader(String header,
Protein.Builder builder) |
public FastaProteinReader(Reader reader)
reader - the reader to read frompublic FastaProteinReader(File file) throws FileNotFoundException
file - the file to readFileNotFoundExceptionpublic void addHeaderParser(FastaHeaderParser parser)
parser - the parser to addpublic boolean hasNext()
IterativeReadertrue if the reader has more elements.
(In other words, returns true if IterativeReader.next() would
return an element rather than throwing an exception.)hasNext in interface IterativeReader<Protein>true if the reader has more elementspublic Protein next() throws IOException
IterativeReadernext in interface IterativeReader<Protein>IOException - if there is an io exceptionpublic void close()
throws IOException
IterativeReaderclose in interface IterativeReader<Protein>IOException - If an I/O error occursprotected void parseHeader(String header, Protein.Builder builder)
Copyright © 2016. All Rights Reserved.