Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::algorithms::Vertex Class Reference

List of all members.

Public Member Functions

 Vertex (Object userObject)
void addAdjacentVertex (Vertex vertex)
Object getUserObject ()
boolean equals (Object obj)
int hashCode ()

Package Functions

int getColor ()
List< VertexgetAdjacencyList ()
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< Vertexm_adjacencyList
Object m_userObject

Detailed Description

A vertex of the graph that the TopologicalSort can work on.


Constructor & Destructor Documentation

alma::acs::algorithms::Vertex::Vertex Object  userObject  )  [inline]
 

Constructor that wraps a node in the graph that has to be sorted.

The userObject must implement reasonable equals() and hashCode() methods.

Parameters:
userObject the application's graph node, to be retrieved later through getUserObject


Member Function Documentation

void alma::acs::algorithms::Vertex::addAdjacentVertex Vertex  vertex  )  [inline]
 

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 vertexA.addAdjacentVertex(vertexB).

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.

Parameters:
vertex another vertex that depends on this vertex.

boolean alma::acs::algorithms::Vertex::equals Object  obj  )  [inline]
 

List<Vertex> alma::acs::algorithms::Vertex::getAdjacencyList  )  [inline, package]
 

int alma::acs::algorithms::Vertex::getColor  )  [inline, package]
 

Object alma::acs::algorithms::Vertex::getUserObject  )  [inline]
 

Returns the application's graph node that was wrapped by this vertex.

int alma::acs::algorithms::Vertex::hashCode  )  [inline]
 

void alma::acs::algorithms::Vertex::setColor int  color  )  [inline, package]
 


Member Data Documentation

final int alma::acs::algorithms::Vertex::BLACK = 3 [static, package]
 

final int alma::acs::algorithms::Vertex::GRAY = 2 [static, package]
 

List<Vertex> alma::acs::algorithms::Vertex::m_adjacencyList [private]
 

int alma::acs::algorithms::Vertex::m_color [private]
 

Object alma::acs::algorithms::Vertex::m_userObject [private]
 

final int alma::acs::algorithms::Vertex::WHITE = 1 [static, package]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:51:23 2009 for ACS Java API by doxygen 1.3.8