Example #1
0
 public void addEdge(IEdge edge) {
   for (IEdge tmpEdge : edges) {
     if (tmpEdge.getOther(this) != null) {
       if (tmpEdge.getOther(this) == edge.getOther(this)) {
         removeEdge(tmpEdge);
       }
     }
   }
   edges.add(edge);
 }
Example #2
0
  @Override
  public String toString() {
    String string = "";

    string += "Node : " + value.toString() + " -- " + edges.size() + "\n";
    List<IEdge> tmpEdges = edges;
    for (IEdge edge : tmpEdges) {
      string += "*Edge : " + edge.getOther(this).getValue().toString() + "\n";
      System.out.println(this.edges.size());
    }

    return string;
  }