ResourceReader
object the encoding is specified.
2015-sep-03 TODO: Only used in com.ibm.icu.dev.test.format, move there.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private int | lineNo
The one-based line number. |
| private BufferedReader | |
| private String | |
| private Class |
| Access | Constructor and Description |
|---|---|
| public | ResourceReader(String
the name of the text file located in this
package's ".data" subpackage. resourceName, String the encoding of the text file; if unsupported
an exception is thrown encoding)Construct a reader object for the text file of the given name in this package, using the given encoding. |
| public | ResourceReader(String
the name of the text file located in this
package's ".data" subpackage. resourceName)Construct a reader object for the text file of the given name in this package, using the default encoding. |
| public | ResourceReader(Class<?> rootClass, String
the name of the text file located in the
given class's package. resourceName, String the encoding of the text file; if unsupported
an exception is thrown encoding)Construct a reader object for the text file of the given name in the given class's package, using the given encoding. |
| public | ResourceReader(InputStream
the input stream of the resource is, String the name of the resource resourceName, String encoding)Construct a reader object for the input stream associated with the given resource name. |
| public | ResourceReader(InputStream
the input stream of the resource is, String the name of the resource resourceName)Construct a reader object for the input stream associated with the given resource name. |
| public | ResourceReader(Class<?> rootClass, String
the name of the text file located in the
given class's package. resourceName)Construct a reader object for the text file of the given name in the given class's package, using the default encoding. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | close()
Implements java. |
| public String | describePosition()
Return a string description of the position of the last line returned by readLine() or readLineSkippingComments(). |
| public int | getLineNumber()
Return the one-based line number of the last line returned by readLine() or readLineSkippingComments(). |
| public String | readLine()
Read and return the next line of the file or |
| public String | readLineSkippingComments(boolean
if true then trim leading Pattern_White_Space. trim)Read a line, ignoring blank lines and lines that start with '#'. |
| public String | |
| public void | reset()
Reset this reader so that the next call to
|
| encoding | back to summary |
|---|---|
| private String encoding | |
| lineNo | back to summary |
|---|---|
| private int lineNo The one-based line number. Has the special value -1 before the object is initialized. Has the special value 0 after initialization but before the first line is read. | |
| reader | back to summary |
|---|---|
| private BufferedReader reader | |
| resourceName | back to summary |
|---|---|
| private String resourceName | |
| root | back to summary |
|---|---|
| private Class<?> root | |
| ResourceReader | back to summary |
|---|---|
| public ResourceReader(String resourceName, String encoding) throws UnsupportedEncodingException Construct a reader object for the text file of the given name in this package, using the given encoding.
| |
| ResourceReader | back to summary |
|---|---|
| public ResourceReader(String resourceName) Construct a reader object for the text file of the given name in this package, using the default encoding.
| |
| ResourceReader | back to summary |
|---|---|
| public ResourceReader(Class<?> rootClass, String resourceName, String encoding) throws UnsupportedEncodingException Construct a reader object for the text file of the given name in the given class's package, using the given encoding.
| |
| ResourceReader | back to summary |
|---|---|
| public ResourceReader(InputStream is, String resourceName, String encoding) Construct a reader object for the input stream associated with the given resource name.
| |
| ResourceReader | back to summary |
|---|---|
| public ResourceReader(InputStream is, String resourceName) Construct a reader object for the input stream associated with the given resource name.
| |
| ResourceReader | back to summary |
|---|---|
| public ResourceReader(Class<?> rootClass, String resourceName) Construct a reader object for the text file of the given name in the given class's package, using the default encoding.
| |
| _reset | back to summary |
|---|---|
| private void _reset() throws UnsupportedEncodingException Reset to the start by reconstructing the stream and readers. We could also use mark() and reset() on the stream or reader, but that would cause them to keep the stream data around in memory. We don't want that because some of the resource files are large, e.g., 400k. | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Closes the underlying reader and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.
| |
| describePosition | back to summary |
|---|---|
| public String describePosition() Return a string description of the position of the last line returned by readLine() or readLineSkippingComments(). | |
| getLineNumber | back to summary |
|---|---|
| public int getLineNumber() Return the one-based line number of the last line returned by readLine() or readLineSkippingComments(). Should only be called after a call to one of these methods; otherwise the return value is undefined. | |
| readLine | back to summary |
|---|---|
| public String readLine() throws IOException Read and return the next line of the file or | |
| readLineSkippingComments | back to summary |
|---|---|
| public String readLineSkippingComments(boolean trim) throws IOException Read a line, ignoring blank lines and lines that start with '#'.
| |
| readLineSkippingComments | back to summary |
|---|---|
| public String readLineSkippingComments() throws IOException Read a line, ignoring blank lines and lines that start with '#'. Do not trim leading Pattern_White_Space. | |
| reset | back to summary |
|---|---|
| public void reset() Reset this reader so that the next call to
| |