|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.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 Graph
addEdge
in class GraphMatrix
vLabel1
- Source vertex.vLabel2
- Destination vertex.label
- Label associated with the edge.public Object removeEdge(Object vLabel1, Object vLabel2)
removeEdge
in interface Graph
removeEdge
in class GraphMatrix
vLabel1
- Source vertex.vLabel2
- Destination vertex.
public int edgeCount()
edgeCount
in interface Graph
edgeCount
in class GraphMatrix
public Iterator edges()
edges
in interface Graph
edges
in class GraphMatrix
public String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |