com.mhhe.clrs2e
Class BFSInfo

java.lang.Object
  |
  +--com.mhhe.clrs2e.BFSInfo
Direct Known Subclasses:
EdmondsKarp.EKInfo

public class BFSInfo
extends java.lang.Object

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


Field Summary
private  java.awt.Color color
          This vertex's color.
private  int d
          Distance of this vertex from the source.
private  com.mhhe.clrs2e.Vertex pi
          This vertex's parent in the predecessor graph.
 
Constructor Summary
BFSInfo()
          Initializes the distance to the maximum integer value, the color to white, and the parent to null.
 
Method Summary
 java.awt.Color getColor()
          Returns the vertex's color.
 int getDistance()
          Returns the vertex's distance.
 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 setDistance(int distance)
          Sets the vertex's distance.
 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
Distance of this vertex from the source.


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

BFSInfo

public BFSInfo()
Initializes the distance to the maximum integer value, the color to white, and the parent to null.

Method Detail

setDistance

public void setDistance(int distance)
Sets the vertex's distance.

Parameters:
distance - The distance.

getDistance

public int getDistance()
Returns the vertex's distance.


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