public boolean removeEdge(E Edge) { // remove edge from inEdges Edge.getToNode().getInEdges().remove(Edge); // remove edge from outEdges Edge.getFromNode().getOutEdges().remove(Edge); edgeKeys.remove(Edge); return super.removeEdge(Edge); }
/** adds edge by HecataeusEdge */ public boolean addEdge(E Edge) { edgeKeys.put(Edge, ++EvolutionGraph._KeyGenerator); // add edge to incoming edges of ToNode V fromNode = (V) Edge.getFromNode(); if (fromNode == null || fromNode.getOutEdges() == null) { if (fromNode == null) { System.out.println( "fromNode=NULL!!! on edge: " + Edge.getName() + " to node:" + Edge.getToNode()); } else { System.out.println("86 line: " + fromNode.getName()); } } if (!fromNode.getOutEdges().contains(Edge)) fromNode.getOutEdges().add(Edge); // add edge to outgoing edges of FromNode V toNode = (V) Edge.getToNode(); if (!toNode.getInEdges().contains(Edge)) toNode.getInEdges().add(Edge); return super.addEdge(Edge, fromNode, toNode); }