wasp.gui
[ class tree: wasp.gui ] [ index: wasp.gui ] [ all elements ]

Class: WizardGraph

Source Location: /gui/WizardGraph.php

Class Overview


Provides Directed Graph Data Structure logic for wizard state transitions.


Author(s):

Variables

Methods



Class Details

[line 29]
Provides Directed Graph Data Structure logic for wizard state transitions.

WizardGraph is a directed graph held by the Wizard, used to determine which card to draw next based on flow logic and user choices.




Tags:

author:  Brian Fioca <brian.fioca@pangomedia.com>


[ Top ]


Class Variables

$_arEdges = array(array())

[line 34]

Matrix of edges



Tags:

access:  protected

Type:   mixed


[ Top ]

$_arVertices = array()

[line 32]

Array of vertices



Tags:

access:  protected

Type:   mixed


[ Top ]

$_iNumber =

[line 37]

Holds an incremented index for the current vertex number



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 42]

WizardGraph __construct( )

Initializes the Graph



[ Top ]

method addEdge [line 66]

void addEdge( $stName1 $stName1, $stName2 $stName2)

Adds an edge between two vertices. The edge is directed such that the first vertex points to the second.



Tags:

access:  public


Parameters:

$stName1   $stName1   the name of the vertex pointing to
$stName2   $stName2   the name of the vertex being pointed at

[ Top ]

method addVertex [line 53]

void addVertex( $stName $stName, mixed $oObject)

Adds a vertex to the graph. The vertex index is assigned by the underlying structure and isn't needed.



Tags:

access:  public


Parameters:

$stName   $stName   the name of the vertex (typically the wizard state string)

[ Top ]

method degreePlus [line 116]

int degreePlus( Vertex $oVertex)

Returns the number of edges going out of the passed in vertex.



Tags:

return:  number of edges
access:  public


[ Top ]

method getIthSuccessor [line 86]

Vertex getIthSuccessor( mixed $iI, Vertex $oVertex)

Returns the ith successor of the vertex $oVertex in the graph



Tags:

return:  or null if it doesn't exist
access:  public


[ Top ]

method getRoot [line 76]

Vertex getRoot( )

Gets the root Vertex of this graph.



Tags:

return:  the root of the graph
access:  public


[ Top ]

method search [line 138]

object the search( $stName 0)

Performs a Breadth First Search of the graph for the passed in Vertex by name.



Tags:

return:  object contained by the found vertex or null if not found.
access:  public


Parameters:

$stName   0   the name of the vertex to search for

[ Top ]


Documentation generated on Sun, 27 Nov 2005 13:16:03 -0500 by phpDocumentor 1.3.0RC3