class Connection { // lines.csv: "station1","station2","line" Station a,b; Integer line; int time; Connection(Station a, Station b, Integer 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("lines9.csv"); for (int i = 1; i < strings.length; i++) { // lines.csv: "station1","station2","line","time" String words[] = split(strings[i],","); int a = stringToAppendedAscii(words[0]); int b = stringToAppendedAscii(words[1]); Integer line = stringToAppendedAscii(words[2]); int t = int(words[3]); if (connections.get(line) == null) { connections.put(line, new Vector()); } Vector lines = (Vector)connections.get(line); Station station_a = (Station)stations.get(new Integer(a)); Station station_b = (Station)stations.get(new Integer(b)); Integer p_line = line; int time = t; //println(station_a); //println(station_b); //println(p_line); //println(time); lines.add(new Connection(station_a, station_b, p_line, time)); } }