| Method Summary | |
boolean |
addEdge(java.lang.Object from,
java.lang.Object to)
Adds a new edge from the vertex from to the vertex to. |
boolean |
addVertex(java.lang.Object vertex)
Adds a new vertex to this graph. |
java.util.Set |
getAdjacentVertices(java.lang.Object vertex)
Returns a set of all adjacent vertices of vertex. |
int |
getNofEdges()
Returns the number of edges in this graph. |
int |
getNofVertices()
Returns the number of vertices of this graph. |
java.util.Set |
getVertices()
Returns a set of all objects refered to by all vertices in this graph. |
boolean |
isDirected()
Is this graph directed? |
boolean |
removeEdge(java.lang.Object from,
java.lang.Object to)
Removes the edge between the vertex from and to. |
| Method Detail |
public boolean addVertex(java.lang.Object vertex)
vertex - the new node to be added.
public boolean addEdge(java.lang.Object from,
java.lang.Object to)
from - add a new edge from the vertex from.to - add a new edge to the vertex to.
public boolean removeEdge(java.lang.Object from,
java.lang.Object to)
from - remove edge from the vertex from.to - remove edge to the vertex to.public boolean isDirected()
public int getNofVertices()
public int getNofEdges()
public java.util.Set getVertices()
public java.util.Set getAdjacentVertices(java.lang.Object vertex)
vertex - we are interested in the adjacent vertices of vertex.