class Connection { // lines.csv: "station1","station2","line" Station a,b; int line; int time; Connection(Station a, Station b, int line, int time) { this.a = a; this.b = b; a.conns.add(this); b.conns.add(this); this.line = line; this.time = time; } } void parseConnections() { String strings[] = loadStrings("lines2.csv"); for (int i = 1; i < strings.length; i++) { // lines.csv: "station1","station2","line" String words[] = split(strings[i],","); String a = words[0]; String b = words[1]; int line = int(words[2]); int t = int(words[3]); if (connections.get(line) == null) { connections.put(line, new ArrayList()); } Vector lines = (Vector)connections.get(line); lines.add(new Connection((Station)stations.get(a),(Station)stations.get(b),line,t)); } }