com.mhhe.clrs2e
Class DFSInfo

java.lang.Object
  |
  +--com.mhhe.clrs2e.DFSInfo

public class DFSInfo
extends java.lang.Object

Class for information determined about a vertex by depth-first search.


Field Summary
private  java.awt.Color color
          This vertex's color.
private  int d
          This vertex's discovery time.
private  int f
          This vertex's finish time.
private  com.mhhe.clrs2e.Vertex pi
          This vertex's parent in the predecessor graph.
 
Constructor Summary
DFSInfo()
          Initializes the discovery and finish times to -1, the color to white, and the parent to null.
 
Method Summary
 java.awt.Color getColor()
          Returns the vertex's color.
 int getDiscoveryTime()
          Returns the vertex's discovery time.
 int getFinishTime()
          Returns the vertex's finish time.
 com.mhhe.clrs2e.Vertex getPredecessor()
          Returns the vertex's parent in the predecessor graph.
 void setColor(java.awt.Color c)
          Sets the vertex's color
 void setDiscoveryTime(int time)
          Sets the vertex's discovery time.
 void setFinishTime(int time)
          Sets the vertex's finish time.
 void setPredecessor(com.mhhe.clrs2e.Vertex v)
          Sets the vertex's parent in the predecessor graph.
 java.lang.String toString()
          Returns the String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

d

private int d
This vertex's discovery time.


f

private int f
This vertex's finish time.


color

private java.awt.Color color
This vertex's color.


pi

private com.mhhe.clrs2e.Vertex pi
This vertex's parent in the predecessor graph.

Constructor Detail

DFSInfo

public DFSInfo()
Initializes the discovery and finish times to -1, the color to white, and the parent to null.

Method Detail

setDiscoveryTime

public void setDiscoveryTime(int time)
Sets the vertex's discovery time.

Parameters:
time - The discovery time.

getDiscoveryTime

public int getDiscoveryTime()
Returns the vertex's discovery time.


setFinishTime

public void setFinishTime(int time)
Sets the vertex's finish time.

Parameters:
time - The finish time.

getFinishTime

public int getFinishTime()
Returns the vertex's finish time.


setColor

public void setColor(java.awt.Color c)
Sets the vertex's color

Parameters:
c - The color.

getColor

public java.awt.Color getColor()
Returns the vertex's color.


setPredecessor

public void setPredecessor(com.mhhe.clrs2e.Vertex v)
Sets the vertex's parent in the predecessor graph.

Parameters:
v - The parent.

getPredecessor

public com.mhhe.clrs2e.Vertex getPredecessor()
Returns the vertex's parent in the predecessor graph.


toString

public java.lang.String toString()
Returns the String representation of this object.

Overrides:
toString in class java.lang.Object