© 1998-2002 McGraw-Hill

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
           
 
Fields inherited from class structure.Vertex
label, visited
 
Constructor Summary
GraphMatrixVertex(Object label, int idx)
           
 
Method Summary
 int index()
           
 String toString()
          Construct a string representing vertex.
 
Methods inherited from class structure.Vertex
equals, hashCode, isVisited, label, reset, visit
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

index

protected int index
Constructor Detail

GraphMatrixVertex

public GraphMatrixVertex(Object label,
                         int idx)
Parameters:
label -  
idx -  
Method Detail

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:
 

© 1998-2002 McGraw-Hill