|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectstructure.AbstractStructure
structure.GraphMatrix
structure.GraphMatrixDirected
public class GraphMatrixDirected
A class implementing a directed, adjacency-matrix based graph. User must commit to upper-bound on number of vertices.
GraphMatrix,
GraphMatrixUndirected,
GraphListDirected| Constructor Summary | |
|---|---|
GraphMatrixDirected(int size)
Construct a directed, adjacency-matrix based graph. |
|
| Method Summary | |
|---|---|
void |
addEdge(Object vLabel1,
Object vLabel2,
Object label)
Add an edge between two vertices within the graph. |
int |
edgeCount()
Determine the number of edges in graph. |
Iterator |
edges()
Construct an traversal over all edges. |
Object |
removeEdge(Object vLabel1,
Object vLabel2)
Remove possible edge between vertices labeled vLabel1 and vLabel2. |
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 |
|---|
equals, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface structure.Structure |
|---|
elements, values |
| Constructor Detail |
|---|
public GraphMatrixDirected(int size)
size - The maximum number of vertices allowed in graph.| Method Detail |
|---|
public void addEdge(Object vLabel1,
Object vLabel2,
Object label)
addEdge in interface GraphaddEdge in class GraphMatrixvLabel1 - Source vertex.vLabel2 - Destination vertex.label - Label associated with the edge.
public Object removeEdge(Object vLabel1,
Object vLabel2)
removeEdge in interface GraphremoveEdge in class GraphMatrixvLabel1 - Source vertex.vLabel2 - Destination vertex.
public int edgeCount()
edgeCount in interface GraphedgeCount in class GraphMatrixpublic Iterator edges()
edges in interface Graphedges in class GraphMatrixpublic String toString()
toString in class Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||