public class SparseStringExtractor extends AbstractStringExtractor
StringExtractor
reads the String
s from a File
as
the user asks for the String
. Instances of this class are sparse
since they do not store an array of String
s internally.Modifier and Type | Field and Description |
---|---|
protected SequenceAnnotationParser |
annotationParser
A parser for the sequence annotation.
|
annotation, FASTA, ignore, ignorePattern, USUALLY
Constructor and Description |
---|
SparseStringExtractor(File f)
A constructor that reads the lines from a file.
|
SparseStringExtractor(File f,
char ignore)
A constructor that reads the lines from a file and ignores
those starting with the comment character
ignore . |
SparseStringExtractor(File f,
char ignore,
String annotation,
SequenceAnnotationParser parser)
A constructor that reads the lines from a file, ignores those
starting with the comment character
ignore and sets the
annotation of the source to annotation . |
SparseStringExtractor(Reader reader,
char ignore,
String annotation,
SequenceAnnotationParser parser)
A constructor that reads the lines from a
Reader , ignores those
starting with the comment character ignore and sets the
annotation of the source to annotation . |
SparseStringExtractor(String fName)
A constructor that reads the lines from a file.
|
SparseStringExtractor(String fName,
char ignore)
A constructor that reads the lines from a file and ignores
those starting with the comment character
ignore . |
SparseStringExtractor(String fName,
char ignore,
SequenceAnnotationParser parser)
A constructor that reads the lines from a file and ignores
those starting with the comment character
ignore . |
SparseStringExtractor(String fName,
char ignore,
String annotation,
SequenceAnnotationParser parser)
A constructor that reads the lines from a file, ignores those
starting with the comment character
ignore and sets the
annotation of the source to annotation . |
SparseStringExtractor(String fName,
SequenceAnnotationParser parser)
A constructor that reads the lines from a file.
|
SparseStringExtractor(String fName,
String annotation,
SequenceAnnotationParser parser)
A constructor that reads the lines from a file and sets the
annotation of the source to
annotation . |
Modifier and Type | Method and Description |
---|---|
protected void |
finalize() |
SequenceAnnotation[] |
getCurrentSequenceAnnotations()
|
boolean |
hasMoreElements() |
String |
nextElement() |
getAnnotation
protected SequenceAnnotationParser annotationParser
public SparseStringExtractor(String fName) throws IOException, FileNotFoundException
fName
- the name of the File
to be read fromIOException
- if the File
could not be readFileNotFoundException
- if the File
could not be foundSparseStringExtractor(String, char)
public SparseStringExtractor(File f) throws IOException
f
- the File
to be read fromIOException
- if the File
could not be readSparseStringExtractor(File, char)
public SparseStringExtractor(String fName, SequenceAnnotationParser parser) throws IOException, FileNotFoundException
fName
- the name of the File
to be read fromparser
- the SequenceAnnotationParser
for the comment linesIOException
- if the File
could not be readFileNotFoundException
- if the File
could not be foundSparseStringExtractor(String, char, SequenceAnnotationParser)
public SparseStringExtractor(String fName, char ignore) throws IOException, FileNotFoundException
ignore
.fName
- the name of the File
to be read fromignore
- the first character of lines that should be treated as
commentsIOException
- if the File
could not be readFileNotFoundException
- if the File
could not be foundSparseStringExtractor(String, char, String, SequenceAnnotationParser)
public SparseStringExtractor(File f, char ignore) throws IOException
ignore
.f
- the File
to be read fromignore
- the first character of lines that should be treated as
commentsIOException
- if the File
could not be readSparseStringExtractor(File, char, String, SequenceAnnotationParser)
public SparseStringExtractor(String fName, char ignore, SequenceAnnotationParser parser) throws IOException, FileNotFoundException
ignore
.fName
- the name of the File
to be read fromignore
- the first character of lines that should be treated as
commentsparser
- the SequenceAnnotationParser
for the comment linesIOException
- if the File
could not be readFileNotFoundException
- if the File
could not be foundSparseStringExtractor(String, char, String, SequenceAnnotationParser)
public SparseStringExtractor(String fName, String annotation, SequenceAnnotationParser parser) throws IOException, FileNotFoundException
annotation
.fName
- the name of the File
to be read fromannotation
- the annotation for the sourceparser
- the SequenceAnnotationParser
for the comment linesIOException
- if the File
could not be readFileNotFoundException
- if the File
could not be foundSparseStringExtractor(String, char, String, SequenceAnnotationParser)
public SparseStringExtractor(String fName, char ignore, String annotation, SequenceAnnotationParser parser) throws IOException, FileNotFoundException
ignore
and sets the
annotation of the source to annotation
.fName
- the name of the File
to be read fromignore
- the first character of lines that should be treated as
commentsannotation
- the annotation for the sourceparser
- the SequenceAnnotationParser
for the comment linesIOException
- if the File
could not be readFileNotFoundException
- if the File
could not be foundAbstractStringExtractor.AbstractStringExtractor(char)
public SparseStringExtractor(File f, char ignore, String annotation, SequenceAnnotationParser parser) throws IOException
ignore
and sets the
annotation of the source to annotation
.f
- the File
to be read fromignore
- the first character of lines that should be treated as
commentsannotation
- the annotation for the sourceparser
- the SequenceAnnotationParser
for the comment linesIOException
- if the File
could not be readpublic SparseStringExtractor(Reader reader, char ignore, String annotation, SequenceAnnotationParser parser) throws IOException
Reader
, ignores those
starting with the comment character ignore
and sets the
annotation of the source to annotation
.reader
- the Reader
to be read fromignore
- the first character of lines that should be treated as
commentsannotation
- the annotation for the sourceparser
- the SequenceAnnotationParser
for the comment linesIOException
- if the File
could not be readpublic boolean hasMoreElements()
public String nextElement()
protected void finalize() throws Throwable
public SequenceAnnotation[] getCurrentSequenceAnnotations()
AbstractStringExtractor
getCurrentSequenceAnnotations
in class AbstractStringExtractor
SequenceAnnotation
or null
if no SequenceAnnotation
is available.