T
- the type of the data to store in Vertices of this graphpublic abstract class UndirectedGraph<T> extends java.lang.Object implements Graph<T>
Constructor and Description |
---|
UndirectedGraph()
Creates a new undirected graph
|
UndirectedGraph(java.util.Collection<T> vertexData)
Creates a new undirected graph with the given data in vertices
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<UndirectedEdge<T>> |
getEdges()
Gets all the edges in the graph
|
java.util.Set<UndirectedVertex<T>> |
getVertices()
Gets all the vertices in the graph
|
void |
removeAllEdges()
Deletes all the edges in the graph
|
void |
removeAllVertices()
Deletes all the vertices in the graph
|
java.lang.String |
toString() |
public UndirectedGraph()
public UndirectedGraph(java.util.Collection<T> vertexData)
vertexData
- the data to make vertices out ofpublic java.util.Set<UndirectedEdge<T>> getEdges()
Graph
public java.util.Set<UndirectedVertex<T>> getVertices()
Graph
getVertices
in interface Graph<T>
public void removeAllEdges()
Graph
removeAllEdges
in interface Graph<T>
public void removeAllVertices()
Graph
removeAllVertices
in interface Graph<T>
public java.lang.String toString()
toString
in class java.lang.Object