Rename method from "is" prefix to "read" prefix because it is not just a test method, it may actually consume input.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1397924 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2012-10-13 18:57:09 +00:00
parent 2a8ce4a11c
commit c7576ccded
3 changed files with 15 additions and 15 deletions

View File

@ -55,7 +55,7 @@ class CSVLexer1 extends Lexer {
* is to call 'readAgain' on the stream... * is to call 'readAgain' on the stream...
*/ */
int c = in.read(); int c = in.read();
boolean eol = isEndOfLine(c); boolean eol = readEndOfLine(c);
c = in.getLastChar(); c = in.getLastChar();
// empty line detection: eol AND (last char was EOL or beginning) // empty line detection: eol AND (last char was EOL or beginning)
@ -66,7 +66,7 @@ class CSVLexer1 extends Lexer {
// go on char ahead ... // go on char ahead ...
lastChar = c; lastChar = c;
c = in.read(); c = in.read();
eol = isEndOfLine(c); eol = readEndOfLine(c);
c = in.getLastChar(); c = in.getLastChar();
// reached end of file without any content (empty line at the end) // reached end of file without any content (empty line at the end)
if (isEndOfFile(c)) { if (isEndOfFile(c)) {
@ -89,7 +89,7 @@ class CSVLexer1 extends Lexer {
while (isWhitespace(c) && !eol) { while (isWhitespace(c) && !eol) {
wsBuf.append((char) c); wsBuf.append((char) c);
c = in.read(); c = in.read();
eol = isEndOfLine(c); eol = readEndOfLine(c);
} }
} }
@ -147,7 +147,7 @@ class CSVLexer1 extends Lexer {
*/ */
private Token simpleTokenLexer(final Token tkn, int c) throws IOException { private Token simpleTokenLexer(final Token tkn, int c) throws IOException {
while (true) { while (true) {
if (isEndOfLine(c)) { if (readEndOfLine(c)) {
// end of record // end of record
tkn.type = EORECORD; tkn.type = EORECORD;
tkn.isReady = true; tkn.isReady = true;
@ -218,7 +218,7 @@ class CSVLexer1 extends Lexer {
tkn.type = EOF; tkn.type = EOF;
tkn.isReady = true; tkn.isReady = true;
return tkn; return tkn;
} else if (isEndOfLine(c)) { } else if (readEndOfLine(c)) {
// ok eo token reached // ok eo token reached
tkn.type = EORECORD; tkn.type = EORECORD;
tkn.isReady = true; tkn.isReady = true;

View File

@ -60,7 +60,7 @@ class CSVLexer1306663 extends Lexer {
* this has no effect outside of the method. so a simple workaround * this has no effect outside of the method. so a simple workaround
* is to call 'readAgain' on the stream... * is to call 'readAgain' on the stream...
*/ */
boolean eol = isEndOfLine(c); boolean eol = readEndOfLine(c);
c = in.getLastChar(); c = in.getLastChar();
// empty line detection: eol AND (last char was EOL or beginning) // empty line detection: eol AND (last char was EOL or beginning)
@ -69,7 +69,7 @@ class CSVLexer1306663 extends Lexer {
// go on char ahead ... // go on char ahead ...
lastChar = c; lastChar = c;
c = in.read(); c = in.read();
eol = isEndOfLine(c); eol = readEndOfLine(c);
c = in.getLastChar(); c = in.getLastChar();
// reached end of file without any content (empty line at the end) // reached end of file without any content (empty line at the end)
if (isEndOfFile(c)) { if (isEndOfFile(c)) {
@ -93,7 +93,7 @@ class CSVLexer1306663 extends Lexer {
if (ignoreSurroundingSpaces) { if (ignoreSurroundingSpaces) {
while (isWhitespace(c) && !eol) { while (isWhitespace(c) && !eol) {
c = in.read(); c = in.read();
eol = isEndOfLine(c); eol = readEndOfLine(c);
} }
} }
@ -142,7 +142,7 @@ class CSVLexer1306663 extends Lexer {
private Token simpleTokenLexer(final Token tkn, int c) throws IOException { private Token simpleTokenLexer(final Token tkn, int c) throws IOException {
// Faster to use while(true)+break than while(tkn.type == INVALID) // Faster to use while(true)+break than while(tkn.type == INVALID)
while (true) { while (true) {
if (isEndOfLine(c)) { if (readEndOfLine(c)) {
tkn.type = EORECORD; tkn.type = EORECORD;
break; break;
} else if (isEndOfFile(c)) { } else if (isEndOfFile(c)) {
@ -207,7 +207,7 @@ class CSVLexer1306663 extends Lexer {
tkn.type = EOF; tkn.type = EOF;
tkn.isReady = true; // There is data at EOF tkn.isReady = true; // There is data at EOF
return tkn; return tkn;
} else if (isEndOfLine(c)) { } else if (readEndOfLine(c)) {
// ok eo token reached // ok eo token reached
tkn.type = EORECORD; tkn.type = EORECORD;
return tkn; return tkn;

View File

@ -54,7 +54,7 @@ class CSVLexer1306667 extends Lexer {
* this has no effect outside of the method. so a simple workaround * this has no effect outside of the method. so a simple workaround
* is to call 'readAgain' on the stream... * is to call 'readAgain' on the stream...
*/ */
boolean eol = isEndOfLine(c); boolean eol = readEndOfLine(c);
c = in.getLastChar(); c = in.getLastChar();
// empty line detection: eol AND (last char was EOL or beginning) // empty line detection: eol AND (last char was EOL or beginning)
@ -63,7 +63,7 @@ class CSVLexer1306667 extends Lexer {
// go on char ahead ... // go on char ahead ...
lastChar = c; lastChar = c;
c = in.read(); c = in.read();
eol = isEndOfLine(c); eol = readEndOfLine(c);
c = in.getLastChar(); c = in.getLastChar();
// reached end of file without any content (empty line at the end) // reached end of file without any content (empty line at the end)
if (isEndOfFile(c)) { if (isEndOfFile(c)) {
@ -93,7 +93,7 @@ class CSVLexer1306667 extends Lexer {
if (ignoreSurroundingSpaces) { if (ignoreSurroundingSpaces) {
while (isWhitespace(c) && !eol) { while (isWhitespace(c) && !eol) {
c = in.read(); c = in.read();
eol = isEndOfLine(c); eol = readEndOfLine(c);
} }
} }
@ -142,7 +142,7 @@ class CSVLexer1306667 extends Lexer {
private Token simpleTokenLexer(final Token tkn, int c) throws IOException { private Token simpleTokenLexer(final Token tkn, int c) throws IOException {
// Faster to use while(true)+break than while(tkn.type == INVALID) // Faster to use while(true)+break than while(tkn.type == INVALID)
while (true) { while (true) {
if (isEndOfLine(c)) { if (readEndOfLine(c)) {
tkn.type = EORECORD; tkn.type = EORECORD;
break; break;
} else if (isEndOfFile(c)) { } else if (isEndOfFile(c)) {
@ -207,7 +207,7 @@ class CSVLexer1306667 extends Lexer {
tkn.type = EOF; tkn.type = EOF;
tkn.isReady = true; // There is data at EOF tkn.isReady = true; // There is data at EOF
return tkn; return tkn;
} else if (isEndOfLine(c)) { } else if (readEndOfLine(c)) {
// ok eo token reached // ok eo token reached
tkn.type = EORECORD; tkn.type = EORECORD;
return tkn; return tkn;