Class pTree

Description

pTreeNode - Generic Node for Tree Implementation

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

  • copyright: CopyrightŪ 2005, PontUKom Corp
  • version: 1.0 First public release
  • author: Guilherme Blanco <guilhermeblanco@gmail.com>

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

pTreeNode
   |
   --pTree
Variable Summary
string $separator
Method Summary
object __construct ([string $treeSeparator = "/"], [string $rootName = "root"])
object add (mixed $node, [mixed $value = null])
void comment (mixed $node, string $comment)
mixed get (mixed $node)
mixed getChild (string $nodeName)
string getLastName (string $nodePath)
object getRoot ()
boolean hasChilds (string $node)
boolean hasValue (string $node)
boolean isRoot (string $node)
void remove (mixed $node)
string toString (integer $mode)
Variables
string $separator = "/" (line 34)
  • var: Tree Path Separator
  • access: protected

Inherited Variables

Inherited from pTreeNode

pTreeNode::$childNodes
pTreeNode::$comment
pTreeNode::$depth
pTreeNode::$name
pTreeNode::$parentNode
pTreeNode::$value
Methods
Constructor __construct (line 45)

Constructor - Generates a Tree Data Structure

  • return: Tree
  • access: public
object __construct ([string $treeSeparator = "/"], [string $rootName = "root"])
  • string $treeSeparator: Path Char Separator
  • string $rootName: Name of Root

Redefinition of:
pTreeNode::__construct()
Constructor - Should not be called directly. Please use addChild instead.
add (line 61)

Add - Insert OR Update Tree Node with Value

  • return: Tree Node Created OR Updated
  • access: public
object add (mixed $node, [mixed $value = null])
  • mixed $node: Node Path or Object
  • mixed $value: Node Value
comment (line 122)

Comment - Insert a Tree Node Comment

  • access: public
void comment (mixed $node, string $comment)
  • mixed $node: Node Name or Object
  • string $comment: Node Comment
get (line 106)

Get - Retrieves Node Value

  • return: Tree Node Value
  • access: public
mixed get (mixed $node)
  • mixed $node: Node Path or Object
getChild (line 138)

Get Child - Retrieve a Child Node of Tree

  • return: Tree Node
  • access: protected
mixed getChild (string $nodeName)
  • string $nodeName: Name of Child Node
getLastName (line 257)

Get Last Name - Retrieves the basename of a given Node Path

  • return: Tree Node Basename (Node Name)
  • access: protected
string getLastName (string $nodePath)
  • string $nodePath: Tree Node Path
getRoot (line 162)

Get Root - Retrieve Root Node

  • return: Root Node of Tree
  • access: public
object getRoot ()
hasChilds (line 196)

Has Childs - Checks if a Tree Node has Childs or not

  • return: Returns TRUE is Tree Node has Childs and FALSE if not
  • access: public
boolean hasChilds (string $node)
  • string $node: Node Name
hasValue (line 217)

Has Value - Checks if a Tree Node has Value or not

  • return: Returns TRUE is Tree Node has Value; FALSE instead
  • access: public
boolean hasValue (string $node)
  • string $node: Node Name
isRoot (line 175)

Is Root - Checks if a given Tree Node is the Root of Tree

  • return: Returns TRUE is Tree Node is the Root of the Tree; FALSE instead
  • access: public
boolean isRoot (string $node)
  • string $node: Node Name
remove (line 88)

Remove - Remove Tree Node and All Sub-Childs

  • access: public
void remove (mixed $node)
  • mixed $node: Node Name or Object
toString (line 238)

To String - Creates a Human readable output of Tree Node

  • return: Formatted readable output of Tree
  • access: public
string toString (integer $mode)
  • integer $mode: Output Mode

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

Inherited Methods

Inherited From pTreeNode

pTreeNode::__construct()
pTreeNode::addChild()
pTreeNode::addComment()
pTreeNode::fromString()
pTreeNode::getAllChilds()
pTreeNode::getChildNode()
pTreeNode::getDepth()
pTreeNode::getName()
pTreeNode::getParent()
pTreeNode::getValue()
pTreeNode::parseValue()
pTreeNode::removeAllChilds()
pTreeNode::removeChild()
pTreeNode::setValue()
pTreeNode::toString()
pTreeNode::__destruct()

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