structure
Class GraphMatrixVertex
java.lang.Object
|
+--structure.Vertex
|
+--structure.GraphMatrixVertex
- class GraphMatrixVertex
- extends Vertex
A private implementation of a vertex for use in graphs that
are internally represented as a Matrix. A vertex
is capable of holding a label and has a flag that can be set
to mark it as visited.
Typical Usage:
Vertex v = new Vertex(someLabel)
;
//...several graph related operations occur
if(!v.isVisited()
){
Object label = v.label();
v.visit()
;
}
- See Also:
GraphListVertex
,
Vertex
Field Summary |
protected int |
index
|
index
protected int index
GraphMatrixVertex
public GraphMatrixVertex(Object label,
int idx)
- Parameters:
label
- idx
-
index
public int index()
- Postcondition:
- returns index associated with vertex
- Returns:
-
toString
public String toString()
- Description copied from class:
Vertex
- Construct a string representing vertex.
- Overrides:
toString
in class Vertex
- Postcondition:
- returns string representation of vertex
- Returns:
-