|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpal.io.FormattedInput
public class FormattedInput
tools to simplify formatted input from an input stream
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static FormattedInput getInstance()
public void nextLine(java.io.PushbackReader in)
throws java.io.IOException
in - input stream
java.io.IOException
public java.lang.String readLine(java.io.PushbackReader in,
boolean keepWhiteSpace)
throws java.io.IOException
in - input streamkeepWhiteSpace - keep or drop white space
java.io.IOException
public int skipWhiteSpace(java.io.PushbackReader in)
throws java.io.IOException
in - input stream
java.io.IOException
public int readNextChar(java.io.PushbackReader input)
throws java.io.IOException
input - input stream
java.io.IOException
public java.lang.String readWord(java.io.PushbackReader in)
throws java.io.IOException
input - stream
java.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 stream
java.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 separator
java.io.IOException
java.lang.NumberFormatException
public int readInt(java.io.PushbackReader in)
throws java.io.IOException,
java.lang.NumberFormatException
in - input stream
java.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 separator
java.io.IOException
java.lang.NumberFormatException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||