mirror of
https://github.com/apache/commons-csv.git
synced 2025-02-07 02:29:11 +00:00
Internal refactoring. If we have a toMap, a toList makes sense (which is already needed internally).
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1560003 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5f9a1987ff
commit
7b27106237
@ -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 Serializable, Iterable<String> {
|
||||
* @return an iterator over the values of this record.
|
||||
*/
|
||||
public Iterator<String> iterator() {
|
||||
return Arrays.asList(values).iterator();
|
||||
return toList().iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -191,6 +192,16 @@ public final class CSVRecord implements Serializable, Iterable<String> {
|
||||
return values.length;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user