Package mil.nga.sf.util
Class TextReader
- java.lang.Object
-
- mil.nga.sf.util.TextReader
-
public class TextReader extends Object
Read through text string- Since:
- 2.0.3
- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description TextReader(Reader reader)
ConstructorTextReader(String text)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the text readerReader
getReader()
Get the readerString
peekToken()
Peek at the next token without reading past itdouble
readDouble()
Read a doubleString
readToken()
Read the next token.
-
-
-
Method Detail
-
getReader
public Reader getReader()
Get the reader- Returns:
- reader
-
close
public void close()
Close the text reader
-
readToken
public String readToken() throws IOException
Read the next token. Ignores whitespace until a non whitespace character is encountered. Returns a contiguous block of token characters ( [a-z] | [A-Z] | [0-9] | - | . | + ) or a non whitespace single character.- Returns:
- token
- Throws:
IOException
- upon read error
-
peekToken
public String peekToken() throws IOException
Peek at the next token without reading past it- Returns:
- next token
- Throws:
IOException
- upon read error
-
readDouble
public double readDouble() throws IOException
Read a double- Returns:
- double
- Throws:
IOException
- upon read error
-
-