예제 #1
0
  public void load(SQLiteAccess query) throws DBException {

    TreeSet<NodeData> nodeList = CollectionUtil.sort(query.amoebaQuery(NodeData.class, "node"));
    TreeSet<EdgeData> edgeList = CollectionUtil.sort(query.amoebaQuery(EdgeData.class, "edge"));

    for (NodeData node : nodeList) {
      _graph.addNode(node.getName());
    }
    for (EdgeData edge : edgeList) {
      _graph.addEdge(
          new Edge(edge.getSrc(), edge.getDest()), EdgeData.translate(edge.getRelationship()));
    }
  }
예제 #2
0
 public void addNode(String nodeName) {
   if (!contains(nodeName)) _graph.addNode(nodeName);
 }