Constructor and Description |
---|
DefaultGraph() |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(E edge)
note that vertices in the new edge are added to the graph
if not there already
|
void |
addEdges(java.util.Collection<E> edges)
note that vertices in the new edges are added to the graph
if not there already
|
void |
addVertex(V vertex) |
void |
addVertices(java.util.Collection<V> vertices) |
int |
getEdgeCount() |
java.util.Collection<E> |
getEdges() |
int |
getVertexCount() |
java.util.Collection<V> |
getVertices() |
boolean |
removeEdge(E edge) |
boolean |
removeEdges(java.util.Collection<E> edges) |
boolean |
removeVertex(V vertex)
remove the vertex.
|
boolean |
removeVertices(java.util.Collection<V> vertices)
remove all vertices in the passed collection,
If any existing edges contain any vertices from the
passed collection, remove those edges, too.
|
public java.util.Collection<V> getVertices()
public java.util.Collection<E> getEdges()
public int getVertexCount()
public int getEdgeCount()
public void addVertex(V vertex)
public boolean removeVertex(V vertex)
public void addVertices(java.util.Collection<V> vertices)
public boolean removeVertices(java.util.Collection<V> vertices)
public void addEdge(E edge)
public boolean removeEdge(E edge)
public void addEdges(java.util.Collection<E> edges)