commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1306322 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
Date Wed, 28 Mar 2012 13:41:42 GMT
Author: sebb
Date: Wed Mar 28 13:41:42 2012
New Revision: 1306322

URL: http://svn.apache.org/viewvc?rev=1306322&view=rev
Log:
Add method for detecting start of line

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java?rev=1306322&r1=1306321&r2=1306322&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java Wed Mar 28 13:41:42
2012
@@ -112,6 +112,16 @@ abstract class Lexer {
     }
 
     /**
+     * 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
      */
     boolean isEndOfFile(int c) {



Mime
View raw message