java.io.Serializable
public class FormattedInput
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Method | Description |
---|---|---|
static FormattedInput |
getInstance() |
create new instance of this object
(note that there is no public constructor
because this class is a singleton!)
|
void |
nextLine(java.io.PushbackReader in) |
go to the beginning of the next line.
|
double |
readDouble(java.io.PushbackReader in) |
read next number from stream and convert it to a double
(newline/cr are treated as separators)
|
double |
readDouble(java.io.PushbackReader in,
boolean ignoreNewlineCR) |
read next number from stream and convert it to a double
|
int |
readInt(java.io.PushbackReader in) |
read next number from stream and convert it to a int
(newline/cr are treated as separators)
|
int |
readInt(java.io.PushbackReader in,
boolean ignoreNewlineCR) |
read next number from stream and convert it to a int
|
java.lang.String |
readLabel(java.io.PushbackReader in,
int maxLength) |
read sequence label from stream
A sequence label is not allowed to contain
whitespace and either of :,;()[]{}.
|
java.lang.String |
readLine(java.io.PushbackReader in,
boolean keepWhiteSpace) |
read a whole line
|
int |
readNextChar(java.io.PushbackReader input) |
read next character from stream
(EOF does not count as character but will throw exception)
|
java.lang.String |
readNumber(java.io.PushbackReader in,
boolean ignoreNewlineCR) |
|
java.lang.String |
readWord(java.io.PushbackReader in) |
read word from stream
|
int |
skipWhiteSpace(java.io.PushbackReader in) |
go to first non-whitespace character
|
public static FormattedInput getInstance()
public void nextLine(java.io.PushbackReader in) throws java.io.IOException
in
- input streamjava.io.IOException
public java.lang.String readLine(java.io.PushbackReader in, boolean keepWhiteSpace) throws java.io.IOException
in
- input streamkeepWhiteSpace
- keep or drop white spacejava.io.IOException
public int skipWhiteSpace(java.io.PushbackReader in) throws java.io.IOException
in
- input streamjava.io.IOException
public int readNextChar(java.io.PushbackReader input) throws java.io.IOException
input
- input streamjava.io.IOException
public java.lang.String readWord(java.io.PushbackReader in) throws java.io.IOException
input
- streamjava.io.IOException
public java.lang.String readLabel(java.io.PushbackReader in, int maxLength) throws java.io.IOException
in
- input streammaxLength
- maximum allowed length of label
(if negative any length is permitted)java.io.IOException
public java.lang.String readNumber(java.io.PushbackReader in, boolean ignoreNewlineCR) throws java.io.IOException
java.io.IOException
public double readDouble(java.io.PushbackReader in) throws java.io.IOException, java.lang.NumberFormatException
in
- input streamjava.io.IOException
java.lang.NumberFormatException
public double readDouble(java.io.PushbackReader in, boolean ignoreNewlineCR) throws java.io.IOException, java.lang.NumberFormatException
in
- input streamignoreNewlineCR
- ignore newline/cr as separatorjava.io.IOException
java.lang.NumberFormatException
public int readInt(java.io.PushbackReader in) throws java.io.IOException, java.lang.NumberFormatException
in
- input streamjava.io.IOException
java.lang.NumberFormatException
public int readInt(java.io.PushbackReader in, boolean ignoreNewlineCR) throws java.io.IOException, java.lang.NumberFormatException
in
- input streamignoreNewlineCR
- ignore newline/cr as separatorjava.io.IOException
java.lang.NumberFormatException