|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.io.StringExtractor
public class StringExtractor
This class implements the reader that extracts strings from either a file or a string. The class ignores lines starting with a given character, since those lines are treated as comments. If the user does not specify this character, it is set to "#" internally. If the user specifies this character as ">", the file or String will be treated as in FastA-format, i.e. lines beginning with > will be stripped and the lines between two > (or until the end of the file) will be appended to form a new String.
| Field Summary | |
|---|---|
static char |
FASTA
The comment-character for FastA-formatted files is '>'. |
static char |
USUALLY
The usual comment-character is #. |
| Constructor Summary | |
|---|---|
StringExtractor(File file,
int initSize)
A constructor that reads the lines from file. |
|
StringExtractor(File file,
int initSize,
char ignore)
A constructor that reads the lines from file and ignores those starting with ignore. |
|
StringExtractor(File file,
int initSize,
char ignore,
String annotation)
A constructor that reads the lines from file and ignores those starting with ignore. |
|
StringExtractor(File file,
int initSize,
String annotation)
A constructor that reads the lines from file . |
|
StringExtractor(String content,
int initSize,
char ignore,
String annotation)
A constructor that reads the lines from a String content and ignores those starting with ignore |
|
StringExtractor(String content,
int initSize,
String annotation)
A constructor that reads the lines from a String content. |
|
| Method Summary | |
|---|---|
String |
getAnnotation()
Returns the annotation of the source. |
int |
getNumberOfStrings()
Returns the number of strings |
String |
getString(int i)
Returns the string with index i. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static char USUALLY
public static char FASTA
| Constructor Detail |
|---|
public StringExtractor(File file,
int initSize)
throws IOException,
FileNotFoundException
file.
file - the file to be read frominitSize - the inital number of lines the can be handled
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
public StringExtractor(File file,
int initSize,
char ignore)
throws IOException,
FileNotFoundException
file and ignores those starting with ignore.
file - the file to be read frominitSize - the inital number of lines the can be handledignore - the first character of lines that should be treated as comments
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
public StringExtractor(File file,
int initSize,
String annotation)
throws IOException,
FileNotFoundException
file .
file - the file to be read frominitSize - the inital number of lines the can be handledannotation - the annotation for the source
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
public StringExtractor(File file,
int initSize,
char ignore,
String annotation)
throws IOException,
FileNotFoundException
file and ignores those starting with ignore.
file - the file to be read frominitSize - the inital number of lines the can be handledignore - the first character of lines that should be treated as commentsannotation - the annotation for the source
IOException - is thrown if the file could not be read
FileNotFoundException - is thrown if the file could not be found
public StringExtractor(String content,
int initSize,
String annotation)
content.
content - the complete String with all linesinitSize - the inital number of lines the can be handledannotation - some annotation for the content
public StringExtractor(String content,
int initSize,
char ignore,
String annotation)
content and ignores those starting with ignore
content - the complete String with all linesinitSize - the inital number of lines the can be handledignore - the first character of lines that should be treated as commentsannotation - some annotation for the content| Method Detail |
|---|
public String getString(int i)
i.
i - the index
ipublic int getNumberOfStrings()
public String getAnnotation()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||