public void removeVertex(VertexType v) {
    if (!vertexList.remove(v)) throw new IllegalArgumentException("removing nonexistent vertex!");

    for (Iterator<EdgeType> i = incomingEdgeIterator(v); i.hasNext(); ) removeEdge(i.next());

    for (Iterator<EdgeType> i = outgoingEdgeIterator(v); i.hasNext(); ) removeEdge(i.next());
  }
示例#2
0
  /*
   * (non-Javadoc)
   *
   * @see
   * edu.umd.cs.findbugs.graph.AbstractGraph#removeEdge(edu.umd.cs.findbugs
   * .graph.AbstractEdge)
   */
  @Override
  public void removeEdge(Edge edge) {
    super.removeEdge(edge);

    // Keep track of removed edges.
    if (removedEdgeList == null) {
      removedEdgeList = new LinkedList<Edge>();
    }
    removedEdgeList.add(edge);
  }