Check out example codes for "csv file data structure java". It will help you in understanding the concepts better.

Code Example 1

HashMap<String, List<String>>
//csv file has 3 columns first column can be used as key

Code Example 2

if you have a lot of holes in you CSV use the comparable as your coordinate
public class Coordinate implements Comparable<Coordinate> {
    public int row;
    public int column;
    public Coordinate(int r, int c) {
        row = r;
        column = c;

    public int compareTo(Coordinate o) {
        int r =, o.row);
        if(r == 0) {
            r =, o.column);
        return r;

    public boolean equals(Object o) {
        if(o instanceof Coordinate) {
            Coordinate c = (Coordinate)o;
            return row == c.row && column == c.column;
        return false;

Code Example 3

List<List<String>> csv = new ArrayList<>();
//Generic answer

Learn ReactJs, React Native from