jebl.evolution.io
public class ImportHelper extends java.lang.Object
Constructor and Description |
---|
ImportHelper(java.io.Reader reader)
ATTENTION: The ImportHelper never closes the reader passed to the constructor.
|
ImportHelper(java.io.Reader reader,
java.io.Writer commentWriter) |
Modifier and Type | Method and Description |
---|---|
void |
clearLastMetaComment() |
void |
closeReader() |
int |
getLastDelimiter() |
java.lang.String |
getLastMetaComment()
Deprecated.
use
getMetaComments() instead |
int |
getLineNumber() |
java.util.List<java.lang.String> |
getMetaComments()
This method has been introduced because this class previously skipped over consecutive comments and discarded all
but the last.
|
double |
getProgress() |
char |
next() |
char |
nextCharacter() |
char |
read()
All read attempts pass through this function.
|
char |
readCharacter() |
double |
readDouble()
Attempts to read and parse a double delimited by whitespace.
|
double |
readDouble(java.lang.String delimiters)
Attempts to read and parse a double delimited by whitespace or by
any character in delimiters.
|
int |
readInteger()
Attempts to read and parse an integer delimited by whitespace.
|
int |
readInteger(java.lang.String delimiters)
Attempts to read and parse an integer delimited by whitespace or by
any character in delimiters.
|
java.lang.String |
readLine()
Reads a line, skipping over any comments.
|
void |
readSequence(java.lang.StringBuilder sequence,
SequenceType sequenceType,
java.lang.String delimiters,
int maxSites,
java.lang.String gapCharacters,
java.lang.String missingCharacters,
java.lang.String matchCharacters,
java.lang.String matchSequence) |
void |
readSequence(java.lang.StringBuilder sequence,
SequenceType sequenceType,
java.lang.String delimiters,
int maxSites,
java.lang.String gapCharacters,
java.lang.String missingCharacters,
java.lang.String matchCharacters,
java.lang.String matchSequence,
boolean stopAtDoubleNewLine) |
void |
readSequence(java.lang.StringBuilder sequence,
SequenceType sequenceType,
java.lang.String delimiters,
int maxSites,
java.lang.String gapCharacters,
java.lang.String missingCharacters,
java.lang.String matchCharacters,
java.lang.String matchSequence,
ProgressListener progress) |
void |
readSequence(java.lang.StringBuilder sequence,
SequenceType sequenceType,
java.lang.String delimiters,
int maxSites,
java.lang.String gapCharacters,
java.lang.String missingCharacters,
java.lang.String matchCharacters,
java.lang.String matchSequence,
ProgressListener progress,
boolean stopAtDoubleNewLine)
Reads sequence, skipping over any comments and filtering using sequenceType.
|
void |
readSequenceLine(java.lang.StringBuffer sequence,
SequenceType sequenceType,
java.lang.String delimiters,
java.lang.String gapCharacters,
java.lang.String missingCharacters,
java.lang.String matchCharacters,
java.lang.String matchSequence)
Reads a line of sequence, skipping over any comments and filtering using sequenceType.
|
java.lang.String |
readToken()
Reads a token stopping when any whitespace or a comment is found.
|
java.lang.String |
readToken(java.lang.String delimiters)
Reads a token stopping when any whitespace, a comment or when any character
in delimiters is found.
|
void |
setCommentDelimiters(char line) |
void |
setCommentDelimiters(char start,
char stop) |
void |
setCommentDelimiters(char start,
char stop,
char line) |
void |
setCommentDelimiters(char start,
char stop,
char line,
char write,
char meta) |
void |
setCommentWriter(java.io.Writer commentWriter) |
void |
setExpectedInputLength(long l) |
void |
skipCharacters(java.lang.String skip)
Skips over any contiguous characters in skip.
|
void |
skipSpace()
Skips over any space (plus tabs and returns) in the file.
|
void |
skipToEndOfLine()
Skips to the end of the line.
|
char |
skipUntil(java.lang.String skip)
Skips over the file until a character from delimiters is found.
|
void |
skipWhile(java.lang.String skip)
Skips char any contiguous characters in skip.
|
void |
unreadCharacter(char ch) |
public ImportHelper(java.io.Reader reader)
reader
- public ImportHelper(java.io.Reader reader, java.io.Writer commentWriter)
public void setExpectedInputLength(long l)
public double getProgress()
public void closeReader() throws java.io.IOException
java.io.IOException
public void setCommentDelimiters(char line)
public void setCommentDelimiters(char start, char stop)
public void setCommentDelimiters(char start, char stop, char line)
public void setCommentDelimiters(char start, char stop, char line, char write, char meta)
public void setCommentWriter(java.io.Writer commentWriter)
public int getLineNumber()
public int getLastDelimiter()
public char nextCharacter() throws java.io.IOException
java.io.IOException
public char readCharacter() throws java.io.IOException
java.io.IOException
public void unreadCharacter(char ch)
public char next() throws java.io.IOException
java.io.IOException
public char read() throws java.io.IOException
java.io.IOException
public java.lang.String readLine() throws java.io.IOException
java.io.IOException
public void readSequence(java.lang.StringBuilder sequence, SequenceType sequenceType, java.lang.String delimiters, int maxSites, java.lang.String gapCharacters, java.lang.String missingCharacters, java.lang.String matchCharacters, java.lang.String matchSequence) throws java.io.IOException, ImportException
java.io.IOException
ImportException
public void readSequence(java.lang.StringBuilder sequence, SequenceType sequenceType, java.lang.String delimiters, int maxSites, java.lang.String gapCharacters, java.lang.String missingCharacters, java.lang.String matchCharacters, java.lang.String matchSequence, boolean stopAtDoubleNewLine) throws java.io.IOException, ImportException
java.io.IOException
ImportException
public void readSequence(java.lang.StringBuilder sequence, SequenceType sequenceType, java.lang.String delimiters, int maxSites, java.lang.String gapCharacters, java.lang.String missingCharacters, java.lang.String matchCharacters, java.lang.String matchSequence, ProgressListener progress) throws java.io.IOException, ImportException
java.io.IOException
ImportException
public void readSequence(java.lang.StringBuilder sequence, SequenceType sequenceType, java.lang.String delimiters, int maxSites, java.lang.String gapCharacters, java.lang.String missingCharacters, java.lang.String matchCharacters, java.lang.String matchSequence, ProgressListener progress, boolean stopAtDoubleNewLine) throws java.io.IOException, ImportException
sequence
- a StringBuilder into which the sequence is putsequenceType
- the sequenceType of the sequencedelimiters
- list of characters that will stop the readinggapCharacters
- list of characters that will be read as gapsmissingCharacters
- list of characters that will be read as missingmatchCharacters
- list of characters that will be read as matching the matchSequencematchSequence
- the sequence string to match match characters tomaxSites
- maximum number of sites to readprogress
- optional ProgressListener. Must not be null.stopAtDoubleNewLine
- if true will stop reading if it encounters two consectutive new line characters.java.io.IOException
ImportException
public void readSequenceLine(java.lang.StringBuffer sequence, SequenceType sequenceType, java.lang.String delimiters, java.lang.String gapCharacters, java.lang.String missingCharacters, java.lang.String matchCharacters, java.lang.String matchSequence) throws java.io.IOException, ImportException
sequence
- a StringBuffer into which the sequence is putsequenceType
- the sequenceType of the sequencedelimiters
- list of characters that will stop the readinggapCharacters
- list of characters that will be read as gapsmissingCharacters
- list of characters that will be read as missingmatchCharacters
- list of characters that will be read as matching the matchSequencematchSequence
- the sequence string to match match characters tojava.io.IOException
ImportException
public int readInteger() throws java.io.IOException, ImportException
java.io.IOException
ImportException
public int readInteger(java.lang.String delimiters) throws java.io.IOException, ImportException
java.io.IOException
ImportException
public double readDouble() throws java.io.IOException, ImportException
java.io.IOException
ImportException
public double readDouble(java.lang.String delimiters) throws java.io.IOException, ImportException
java.io.IOException
ImportException
public java.lang.String readToken() throws java.io.IOException
java.io.IOException
public java.lang.String readToken(java.lang.String delimiters) throws java.io.IOException
java.io.IOException
public void skipToEndOfLine() throws java.io.IOException
java.io.IOException
public void skipWhile(java.lang.String skip) throws java.io.IOException
java.io.IOException
public void skipSpace() throws java.io.IOException
java.io.IOException
public void skipCharacters(java.lang.String skip) throws java.io.IOException
java.io.IOException
public char skipUntil(java.lang.String skip) throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> getMetaComments()
clearLastMetaComment()
was last called.clearLastMetaComment()
@Deprecated public java.lang.String getLastMetaComment()
getMetaComments()
insteadpublic void clearLastMetaComment()
http://code.google.com/p/jebl2/