示例#1
0
  /**
   * 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
  /**
   * 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;
  }