addNewEdge
public Edge addNewEdge(Vertex firstEndpoint,
Vertex secondEndpoint)
Add a new edge to the graph which joins the given (existing) vertices.
- addNewEdge in interface Graph
addNewVertex
public Vertex addNewVertex()
Create a new vertex and add it to the graph. The index of this
newly created vertex should be equal to the number of vertices
in the graph before that vertex was added.
- addNewVertex in interface Graph
- the newly created vertex.
clear
public void clear()
Remove all vertices and all edges from this graph.
- clear in interface Graph
copy
public void copy(GraphView original)
Make this graph a copy of the given view. Corresponding vertices will have
the same index in the copy as in the original. This graph will be cleared
prior to the copy operation.
- copy in interface Graph
finalizeRemoveEdge
protected void finalizeRemoveEdge(Edge edge)
finalizeRemoveVertex
protected void finalizeRemoveVertex(Vertex v)
getModCount
public int getModCount()
Returns the modification count of this graph. This count is incremented
every time the graph is changed and serves as a kind of version
number for this object.
remove
protected void remove(int index)
Remove vertex at given index position. The index is known to be
within range.
Extension classes should override this method rather than
remove(Vertex)
which calls this method.
This method is also used by the vertex iterator of this class.
remove
public void remove(Edge e)
Remove the given edge from the graph.
- remove in interface Graph
remove
public void remove(Vertex v)
Remove the given vertex from the graph. Also removes all
edges incident with this vertex. Removing a vertex makes its index negative
and may change the indices of other vertices in the same graph.
- remove in interface Graph