public void replace(final List<Edge> removeList,final Edge newEdge){
  final Edge previous=previousEdges.get(removeList.get(0));
  final Edge next=nextEdges.get(removeList.get(removeList.size() - 1));
  edges.add(newEdge);
  previousEdges.put(newEdge,previous);
  nextEdges.put(previous,newEdge);
  previousEdges.put(next,newEdge);
  nextEdges.put(newEdge,next);
  for (  final Edge edge : removeList) {
    if (edge == oneEdge) {
      oneEdge=newEdge;
    }
    edges.remove(edge);
    previousEdges.remove(edge);
    nextEdges.remove(edge);
  }
}

public void replace ( final List < Edge > removeList , final Edge newEdge ) { final Edge previous = previousEdges . get ( removeList . get ( 0 ) ) ; final Edge next = nextEdges . get ( removeList . get ( removeList . size ( ) - 1 ) ) ; edges . add ( newEdge ) ; previousEdges . put ( newEdge , previous ) ; nextEdges . put ( previous , newEdge ) ; previousEdges . put ( next , newEdge ) ; nextEdges . put ( newEdge , next ) ; for ( final Edge edge : removeList ) { if ( edge == oneEdge ) { oneEdge = newEdge ; } edges . remove ( edge ) ; previousEdges . remove ( edge ) ; nextEdges . remove ( edge ) ; } }
replace a list of edges with a new edge .
