Iterator i = _data.values().iterator();
Iterator i;
	public DGraph buildGraph() {		// create all edges first, then filter out invalid edges then vertices		// invalid vertices are those which are not connected to any other one		HashMap vertmap = new HashMap();		HashMap edgemap = new HashMap();		Iterator i = _data.values().iterator();		DGraph graph;		int j;		// collect all the edge and graph objects		while(i.hasNext()) {			String [] data = (String []) i.next();			String source = data[VERTEX_ID];			String [] edges = data[VERTEX_OUTEDGE].split(",");			String [] edgelen = data[VERTEX_EDGELEN].split(",");			int [] lengths = new int[edges.length];			if(!vertmap.containsKey(source)) {				vertmap.put(source, new DVertex(source));			}			// parse edge lengths			if(edgelen.length != edges.length) {				System.err.println("Warning: the edge lengths provided for vertex " + source + " do not map correctly.  Setting all edge lengths to 1.");				for(j = 0; j < lengths.length; j++) {					lengths[j] = 1;				}			} else if (data[VERTEX_OUTEDGE].length() > 0) {				// only parse if there are outedges for this vertex				for(j = 0; j < lengths.length; j++) {					try {						lengths[j] = java.lang.Integer.parseInt(edgelen[j]);					} catch (java.lang.NumberFormatException e) {						System.err.println("Warning: could not parse length '" + edgelen[j] + "' for vertex " + source + ".  Setting value to 1.");						lengths[j] = 1;					}				}			}			// create vertices and edges			for(j = 0; j < edges.length; j++) {				String dest = edges[j].trim();				if(dest.length() < 1) {					// no outgoing edges for this vertex					continue;				} else if (dest.equals(source)) {					System.err.println("Warning: attempted to create an edge using two identical vertices (" + source + ").");					continue;				}				// make sure the destination exists				if(_data.containsKey(dest)) {					// create the nodes					if(!vertmap.containsKey(dest)) {						vertmap.put(dest, new DVertex(dest));					}					try {						DEdge e = new DEdge((DVertex) vertmap.get(source), (DVertex) vertmap.get(dest), (float) lengths[j]);						edgemap.put(source + "->" + dest, e);					} catch (IllegalArgumentException e) {						System.out.println("source=" + source + "       dest=" + dest);						System.err.println("Error: " + e.toString());					}				} else {					// invalid edge, notify					System.err.println("Warning: the vertex " + dest + " does not exist in the data file and will not be added.");				}			}		}		// reuse i - construct the graph		graph = new DGraph();		i = vertmap.values().iterator();		while(i.hasNext()) {			graph.add((DVertex) i.next());		}		i = edgemap.values().iterator();		while(i.hasNext()) {			graph.add((DEdge) i.next());		}		// enter in extra attributes		i = vertmap.values().iterator();		while(i.hasNext()) {			DVertex v = (DVertex) i.next();			String [] data = (String []) _data.get(v.id());			for(j = VERTEX_CUSTOM; j < data.length; j++) {				if(j - VERTEX_CUSTOM < _attributes.length) {					String aname = _attributes[j - VERTEX_CUSTOM];					// URL support					if(aname.equals("URL")) {						URL url = null;						Datum d = null;						try {							url = new URL(data[j]);							d = new Datum(aname, url);						} catch (java.net.MalformedURLException exception) {							d = new Datum(aname, data[j]);						}						v.setDatum(d);					} else {						v.setDatum(new Datum(_attributes[j - VERTEX_CUSTOM], data[j]));					}				} else {					System.err.println("Syntax error: too many attributes for vertex '" + v.id() + "'");				}			}		}		return graph;	}