src/main/java/de/dfki/lt/loot/digraph/io/SimpleGraphReader.java
public static
  void readNodePositionGraph(Reader in,
      final Graph<Double> result)
      throws IOException {

    final VertexPropertyMap<Vector> nodePos = new VertexListPropertyMap<Vector>(result);
    result.register("nodePos", nodePos);

    readGraphGeneric(in, result,
        (vertex, infoString) -> {
          String[] c = infoString.split("\\s*,\\s*");
          nodePos.put(vertex,
              new Vector(Double.parseDouble(c[0]), Double.parseDouble(c[1])));
        },
        (edge, infoString) -> null);
  }
/**
   * Creates a graph from a readable specification including node positions.
   *
   * @param in
   *          the reader from which to read the graph
   * @return the graph
   * @throws IOException
   *           if there is an error when reading the graph
   */
Creates a graph from a readable specification including node positions.
@param in
the reader from which to read the graph
@return the graph
@throws IOException
if there is an error when reading the graph
Creates a graph from a readable specification including node positions . @param in the reader from which to read the graph @return the graph @throws IOException if there is an error when reading the graph
public static
  void readNodePositionGraph(Reader in,
      final Graph<Double> result)
      throws IOException {
    final VertexPropertyMap<Vector> nodePos = new VertexListPropertyMap<Vector>(result);
    result.register("nodePos", nodePos);
    readGraphGeneric(in, result,
        (vertex, infoString) -> {
          String[] c = infoString.split("\\s*,\\s*");
          nodePos.put(vertex,
              new Vector(Double.parseDouble(c[0]), Double.parseDouble(c[1])));
        },
        (edge, infoString) -> null);
  }
public static void readNodePositionGraph ( Reader in , final Graph < Double > result ) throws IOException { final VertexPropertyMap < Vector > nodePos = new VertexListPropertyMap < Vector > ( result ) ; result . register ( "nodePos" , nodePos ) ; readGraphGeneric ( in , result , ( vertex , infoString ) -> { String [ ] c = infoString . split ( "\\s*,\\s*" ) ; nodePos . put ( vertex , new Vector ( Double . parseDouble ( c [ 0 ] ) , Double . parseDouble ( c [ 1 ] ) ) ) ; } , ( edge , infoString ) -> null ) ; }
Creates a graph from a readable specification including node positions.
Creates a graph from a readable specification including node positions .