private void writeEdges(Writer writer, List<Edge> edges, Map<Vertex, Integer> ids) throws IOException { for (Edge e : edges) { writeEdgeProperties( writer, e, ids.get(e.getVertex(Direction.OUT)), ids.get(e.getVertex(Direction.IN))); } }
private void writeVerticies(Writer writer, List<Vertex> verticies, Map<Vertex, Integer> ids) throws IOException { int count = 1; for (Vertex v : verticies) { if (useId) { Integer id = Integer.valueOf(v.getId().toString()); writeVertex(writer, v, id); ids.put(v, id); } else { writeVertex(writer, v, count); ids.put(v, count++); } } }
private void writeMapProperty(Writer writer, Map<?, ?> map, int tabs) throws IOException { writer.write(OPEN_LIST); tabs++; for (Entry<?, ?> entry : map.entrySet()) { writeTabs(writer, tabs); writeKey(writer, entry.getKey().toString()); writeProperty(writer, entry.getValue(), tabs); } writeTabs(writer, tabs - 1); writer.write(CLOSE_LIST); }