|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.AbstractStructure structure.GraphMatrix structure.GraphMatrixUndirected
public class GraphMatrixUndirected
A class implementing an undirected, adjacency-matrix based graph. User must commit to upper bound on number of vertices in graph.
GraphMatrix
,
GraphMatrixDirected
,
GraphListUndirected
Field Summary |
---|
Fields inherited from class structure.GraphMatrix |
---|
data, dict, directed, freeList, size |
Constructor Summary | |
---|---|
GraphMatrixUndirected(int size)
Construct an undirected, adjacency-matrix based graph. |
Method Summary | |
---|---|
void |
addEdge(java.lang.Object vLabel1,
java.lang.Object vLabel2,
java.lang.Object label)
Add an edge between two vertices within the graph. |
int |
edgeCount()
Determine the number of edges in graph. |
java.util.Iterator |
edges()
Construct an traversal over all edges. |
java.lang.Object |
removeEdge(java.lang.Object vLabel1,
java.lang.Object vLabel2)
Remove possible edge between vertices labeled vLabel1 and vLabel2. |
java.lang.String |
toString()
Construct a string representation of graph. |
Methods inherited from class structure.GraphMatrix |
---|
add, clear, contains, containsEdge, degree, get, getEdge, isDirected, isEmpty, isVisited, isVisitedEdge, iterator, neighbors, remove, reset, size, visit, visitEdge |
Methods inherited from class structure.AbstractStructure |
---|
elements, hashCode, values |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface structure.Structure |
---|
elements, values |
Constructor Detail |
---|
public GraphMatrixUndirected(int size)
size
- Maximum number of vertices in graph.Method Detail |
---|
public void addEdge(java.lang.Object vLabel1, java.lang.Object vLabel2, java.lang.Object label)
addEdge
in interface Graph
addEdge
in class GraphMatrix
vLabel1
- One vertex.vLabel2
- Another vertex.label
- Label associated with the edge.public java.lang.Object removeEdge(java.lang.Object vLabel1, java.lang.Object vLabel2)
removeEdge
in interface Graph
removeEdge
in class GraphMatrix
vLabel1
- One vertex.vLabel2
- Another vertex.
public int edgeCount()
edgeCount
in interface Graph
edgeCount
in class GraphMatrix
public java.util.Iterator edges()
edges
in interface Graph
edges
in class GraphMatrix
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |