2015-sep-03 TODO: Only used in com.ibm.icu.dev.test.format, move there.
| Modifier and Type | Field and Description |
|---|---|
| private StringBuffer | |
| private boolean | |
| private int | |
| private String | |
| private int | |
| private ResourceReader |
| Access | Constructor and Description |
|---|---|
| public | TokenIterator(ResourceReader r)
Construct an iterator over the tokens returned by the given ResourceReader, ignoring blank lines and comment lines (first non-blank character is '#'). |
| Modifier and Type | Method and Description |
|---|---|
| public String | describePosition()
Return a string description of the position of the last line returned by readLine() or readLineSkippingComments(). |
| public int | |
| public String | |
| private int | Returns: offset to the next character to read from line, or if the end of the line is reached without scanning a valid token, -1the offset into the string position)Read the next token from 'this.line' and append it to 'this.buf'. |
| buf | back to summary |
|---|---|
| private StringBuffer buf | |
| done | back to summary |
|---|---|
| private boolean done | |
| lastpos | back to summary |
|---|---|
| private int lastpos | |
| line | back to summary |
|---|---|
| private String line | |
| pos | back to summary |
|---|---|
| private int pos | |
| reader | back to summary |
|---|---|
| private ResourceReader reader | |
| TokenIterator | back to summary |
|---|---|
| public TokenIterator(ResourceReader r) Construct an iterator over the tokens returned by the given ResourceReader, ignoring blank lines and comment lines (first non-blank character is '#'). Note that trailing comments on a line, beginning with the first unquoted '#', are recognized. | |
| 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 line of the last token returned by next(). Should only be called after a call to next(); otherwise the return value is undefined. | |
| next | back to summary |
|---|---|
| public String next() throws IOException Return the next token from this iterator, or null if the last token has been returned. | |
| nextToken | back to summary |
|---|---|
| private int nextToken(int position) Read the next token from 'this.line' and append it to 'this.buf'. Tokens are separated by Pattern_White_Space. Tokens may also be delimited by double or single quotes. The closing quote must match the opening quote. If a '#' is encountered, the rest of the line is ignored, unless it is backslash-escaped or within quotes.
| |