Class pTreeNode

Description

pTreeNode - Generic Node for Tree Implementation

This class provides a Tree Node definition for generic tree data structure implementation

  • version: 1.0 First public release
  • access: protected
  • copyright: CopyrightŪ 2005, PontUKom Corp
  • author: Guilherme Blanco <guilhermeblanco@gmail.com>
  • updated: No updates yet
  • created: 2005-02-19 16:04 GMT - 3:00hs

Located in /class.pTree.php (line 282)


	
			
Direct descendents
Class Description
pTree pTreeNode - Generic Node for Tree Implementation
Variable Summary
array $childNodes
string $comment
integer $depth
string $name
object $parentNode
string $value
Method Summary
object __construct (string $nodeName, [object $parentNode = null])
void __destruct ()
object addChild (string $node, [mixed $value = null])
void addComment ([string $nodeComment = ""])
object fromString ([string $input = ""])
array getAllChilds ()
mixed getChildNode (string $nodeName)
integer getDepth ()
string getName ()
object getParent ()
mixed getValue ()
mixed parseValue (mixed $nodeValue, integer $type)
boolean removeAllChilds ()
boolean removeChild (mixed $node)
void setValue (mixed $nodeValue)
string toString (integer $mode)
Variables
array $childNodes = array() (line 312)
  • var: Child Nodes
  • access: protected
string $comment = "" (line 306)
  • var: Node Comment
  • access: private
integer $depth = -1 (line 318)
  • var: Depth of Node
  • access: private
string $name = "" (line 288)
  • var: Node Name
  • access: protected
object $parentNode = null (line 300)
  • var: Parent TreeNode Reference
  • access: private
string $value = null (line 294)
  • var: Node Value
  • access: private
Methods
Constructor __construct (line 330)

Constructor - Should not be called directly. Please use addChild instead.

object __construct (string $nodeName, [object $parentNode = null])
  • string $nodeName: Name of Tree Node
  • object $parentNode: Parent Tree Node reference, if any

Redefined in descendants as:
Destructor __destruct (line 350)

Destructor - Should not be called directly. This does the same as removeAllChilds method.

void __destruct ()
addChild (line 435)

Add - Add a Tree Node with Value

  • return: Generated Tree Node
  • access: protected
object addChild (string $node, [mixed $value = null])
  • string $node: Node Name
  • mixed $value: Value of new Node
addComment (line 514)

Add Comment - Set up a Tree Node Comment

  • access: protected
void addComment ([string $nodeComment = ""])
  • string $nodeComment: Comment of Tree Node
fromString (line 564)

From String - Generates Tree Structure using Formatted String Entry (reverse of toString method)

object fromString ([string $input = ""])
  • string $input: Formatted input of Tree
getAllChilds (line 375)

Get All Childs - Retrieve All Child Nodes of the given Tree Node

  • return: Tree Nodes array
  • access: protected
array getAllChilds ()
getChildNode (line 363)

Get Child - Retrieve a Child Node of the given Tree Node

  • return: Tree Node
  • access: protected
mixed getChildNode (string $nodeName)
  • string $nodeName: Name of Child Node
getDepth (line 490)

Get Depth - Grab Tree Node Depth

  • return: Depth of Tree Node
  • access: public
integer getDepth ()
getName (line 502)

Get Name - Retrieve Tree Node Name

  • return: Name of Tree Node
  • access: public
string getName ()
getParent (line 454)

Get Parent - Retrieve the parent Tree Node of item, or item if none

  • return: Tree Node
  • access: public
object getParent ()
getValue (line 478)

Get Value - Get the Value of given Tree Node

  • return: Value of Tree Node
  • access: public
mixed getValue ()
parseValue (line 615)

Parse Value - Encode/Decode Value parameter

  • return: Value of Node
  • access: private
mixed parseValue (mixed $nodeValue, integer $type)
  • mixed $nodeValue: Value of Node (encoded or decoded)
  • integer $type: Type of processment: [0] Encode / [1] Decode
removeAllChilds (line 412)

Remove All Childs - Remove All Child Nodes

  • return: TRUE
  • access: protected
boolean removeAllChilds ()
removeChild (line 389)

Remove Child - Remove Child Node

boolean removeChild (mixed $node)
  • mixed $node: Name of Child Node or Child Tree Node Object
setValue (line 466)

Set Value - Set up a Value in Tree Node

  • access: protected
void setValue (mixed $nodeValue)
  • mixed $nodeValue: Value of a Tree Node
toString (line 528)

To String - Creates a Human readable output of Tree Node (reverse of fromString method)

string toString (integer $mode)
  • integer $mode: Output Mode

Redefined in descendants as:

Documentation generated on Sun, 20 Feb 2005 23:03:05 -0300 by phpDocumentor 1.3.0RC3