You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2014/09/17 05:02:22 UTC

svn commit: r1625456 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java

Author: ggregory
Date: Wed Sep 17 03:02:22 2014
New Revision: 1625456

URL: http://svn.apache.org/r1625456
Log:
[CSV-131] Save positions of records to enable random access. 2nd commit for this new feature. Let the Lexer make the underlying reader's character position available through a new package private method.

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=1625456&r1=1625455&r2=1625456&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 Sep 17 03:02:22 2014
@@ -34,7 +34,7 @@ import java.io.Closeable;
 import java.io.IOException;
 
 /**
- *
+ * Lexical analyzer. 
  *
  * @version $Id$
  */
@@ -301,6 +301,15 @@ final class Lexer implements Closeable {
         return reader.getCurrentLineNumber();
     }
 
+    /**
+     * Returns the current character position
+     *
+     * @return the current character position
+     */
+    long getCharacterPosition() {
+        return reader.getPosition();
+    }
+
     // TODO escape handling needs more work
     /**
      * Handle an escape sequence.