Add method for detecting start of line

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306322 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-03-28 13:41:42 +00:00
parent 93089b260c
commit 0fee01aa2d
1 changed files with 10 additions and 0 deletions

View File

@ -111,6 +111,16 @@ abstract class Lexer {
return (c == '\n' || c == '\r');
}
/**
* Checks if the current character represents the start of a line:
* a CR, LF or is at the start of the file.
*
* @param c
* @return true if the character is at the start of a line.
*/
boolean isStartOfLine(int c) {
return c == '\n' || c == '\r' || c == ExtendedBufferedReader.UNDEFINED;
}
/**
* @return true if the given character indicates end of file
*/