|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.BFSInfo
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 |
private int d
private java.awt.Color color
private com.mhhe.clrs2e.Vertex pi
Constructor Detail |
public BFSInfo()
null
.
Method Detail |
public void setDistance(int distance)
distance
- The distance.public int getDistance()
public void setColor(java.awt.Color c)
c
- The color.public java.awt.Color getColor()
public void setPredecessor(com.mhhe.clrs2e.Vertex v)
v
- The parent.public com.mhhe.clrs2e.Vertex getPredecessor()
public java.lang.String toString()
String
representation of this object.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |