commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1560003 - /commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
Date Tue, 21 Jan 2014 13:34:35 GMT
Author: ggregory
Date: Tue Jan 21 13:34:34 2014
New Revision: 1560003

URL: http://svn.apache.org/r1560003
Log:
Internal refactoring. If we have a toMap, a toList makes sense (which is already needed internally).

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

Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java?rev=1560003&r1=1560002&r2=1560003&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java (original)
+++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVRecord.java Tue Jan 21
13:34:34 2014
@@ -21,6 +21,7 @@ import java.io.Serializable;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 
@@ -166,7 +167,7 @@ public final class CSVRecord implements 
      * @return an iterator over the values of this record.
      */
     public Iterator<String> iterator() {
-        return Arrays.asList(values).iterator();
+        return toList().iterator();
     }
 
     /**
@@ -192,6 +193,16 @@ public final class CSVRecord implements 
     }
 
     /**
+     * Convert the values to a List.
+     * 
+     * TODO: Maybe make this public?
+     * @return a new List
+     */
+    private List<String> toList() {
+        return Arrays.asList(values);
+    }
+
+    /**
      * Converts this record into a Map.
      * 
      * @return A new Map. The map is empty if the record has no headers.



Mime
View raw message