- Type Parameters:
V- the vertex typeA- the arrow data type
- All Superinterfaces:
BareDirectedGraph<V,,A> BareDirectedVertexGraph<V>,DirectedGraph<V,A>
- All Known Subinterfaces:
MutableBidiGraph<V,A>
- All Known Implementing Classes:
SimpleMutableBidiGraph,SimpleMutableDirectedGraph
Interface for a mutable directed graph.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an arrow from vertex v to vertex u.voidAdds a vertex to the graph if it is not already in the graph.voidremoveArrow(@NonNull V v, @NonNull V u) Removes the first arrow from vertex v to vertex u.voidRemoves the first arrow from vertex v to vertex u that has the same data value.voidremoveNext(@NonNull V v, int k) Removes the k-th next arrow from vertex v.voidRemoves a vertex from the graph if it is in the graph.Methods inherited from interface org.jhotdraw8.graph.BareDirectedGraph
getNextArrowMethods inherited from interface org.jhotdraw8.graph.BareDirectedVertexGraph
getNext, getNextCount, getVerticesMethods inherited from interface org.jhotdraw8.graph.DirectedGraph
findArrow, findIndexOfNext, getArrowCount, getArrows, getArrows, getNextArc, getNextArcs, getNextArrows, getNextVertices, getVertex, getVertexCount, isNext, searchNextVertices, searchNextVertices
-
Method Details
-
addVertex
Adds a vertex to the graph if it is not already in the graph.- Parameters:
v- vertex data
-
removeVertex
Removes a vertex from the graph if it is in the graph.- Parameters:
v- vertex data
-
addArrow
Adds an arrow from vertex v to vertex u.This method adds additional an arrow if the arrow is already in the graph.
- Parameters:
v- vertex data vu- vertex data ua- arrow data
-
removeArrow
Removes the first arrow from vertex v to vertex u that has the same data value.- Parameters:
v- vertex data vu- vertex data ua- arrow data
-
removeArrow
Removes the first arrow from vertex v to vertex u.- Parameters:
v- vertex data vu- vertex data u
-
removeNext
Removes the k-th next arrow from vertex v.- Parameters:
v- vertex data vk- index of arrow to be removed
-