/** * {@inheritDoc} */ public override E addEdge(V sourceVertex, V targetVertex) { assertVertexExist(sourceVertex); assertVertexExist(targetVertex); if (!allowingMultipleEdges && containsEdge(sourceVertex, targetVertex)) { return(default(E)); } if (!allowingLoops && sourceVertex.Equals(targetVertex)) { throw new ArgumentException(LOOPS_NOT_ALLOWED); } E e = edgeFactory.createEdge(sourceVertex, targetVertex); if (containsEdge(e)) { // this restriction should stay! return(default(E)); } else { intrusiveEdgesSpecifics.add(e, sourceVertex, targetVertex); specifics.addEdgeToTouchingVertices(e); return(e); } }