コード例 #1
0
ファイル: GraphMapper.java プロジェクト: namtar/graph
  /**
   * Maps a {@link XmlGraph} to a {@link Graph}.
   *
   * @param xmlGraph the {@link XmlGraph} to be mapped
   * @return the mapped {@link Graph}
   */
  public static Graph mapXmlGraphToGraph(XmlGraph xmlGraph) {

    Graph graph = new Graph();

    graph.setAdjacencyList(mapXmlAdjacencyWrapperToMap(xmlGraph.getAdjacencyWrapper()));

    return graph;
  }
コード例 #2
0
ファイル: GraphMapper.java プロジェクト: namtar/graph
  /**
   * Maps a {@link Graph} to a {@link XmlGraph}.
   *
   * @param graph the {@link Graph} to be mapped
   * @return the mapped {@link XmlGraph}
   */
  public static XmlGraph mapGraphToXmlGraph(Graph graph) {

    XmlGraph xGraph = new XmlGraph();

    xGraph.setAdjacencyWrapper(mapAdjacencyListToXmlAdjacencyWrapper(graph.getAdjacencyList()));

    return xGraph;
  }