Public Member Functions | |
Vertex (Object userObject) | |
void | addAdjacentVertex (Vertex vertex) |
Object | getUserObject () |
boolean | equals (Object obj) |
int | hashCode () |
Package Functions | |
int | getColor () |
List< Vertex > | getAdjacencyList () |
void | setColor (int color) |
Static Package Attributes | |
final int | WHITE = 1 |
final int | GRAY = 2 |
final int | BLACK = 3 |
Private Attributes | |
int | m_color |
List< Vertex > | m_adjacencyList |
Object | m_userObject |
|
Constructor that wraps a node in the graph that has to be sorted.
The
|
|
Adds a dependent vertex to this vertex.
The direction of the graph is from "must occur first" to "may occur later". If node B depends on node A, then call To use the example from Cormen, if you want to figure out in which order to put on your clothes, the vertex for socks must point to the vertex for shoes, stating that socks must be put on before you can put on your shoes, or in other words, that shoes depend on socks. So add the shoe vertex to the sock's adjacent vertex list.
|
|
|
|
|
|
|
|
Returns the application's graph node that was wrapped by this vertex. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|