data_structures
[ class tree: data_structures ] [ index: data_structures ] [ all elements ]

Source for file TreeNode.class.php

Documentation is available at TreeNode.class.php

  1. <?php
  2. /**
  3.  * For including this file you have to define the constant "CLASSPATH".
  4.  * Because every include in the framework depends on the CLASSPATH definition.
  5.  * The CLASSPATH means the relative path to the folder that contains the
  6.  * framework GilliGan.
  7.  *
  8.  * @package data_structures
  9.  */
  10. if!defined"CLASSPATH" ) )
  11. {
  12.   echo "<h3>You have to define the constant CLASSPATH!</h3>\r\n";
  13.   echo "Example: define( 'CLASSPATH', '../path/to/classes/' );\r\n";
  14.   exit();
  15. }
  16.  
  17. /**
  18.  * Loading the parent class.
  19.  */
  20. require_onceCLASSPATH."data_structures/TreeRoot.class.php" );
  21.  
  22. /**
  23.  * @version   0.1.1
  24.  * @package   data_structures
  25.  * @author    Daniel Plücken <daniel@debakel.net>
  26.  * @license   http://www.gnu.org/copyleft/lesser.html
  27.  *             GNU Lesser General Public License
  28.  * @copyright Copyright (C) 2005 Daniel Plücken <daniel@debakel.net>
  29.  *
  30.  *  This library is free software; you can redistribute it and/or
  31.  *  modify it under the terms of the GNU Lesser General Public
  32.  *  License as published by the Free Software Foundation; either
  33.  *  version 2.1 of the License.
  34.  *
  35.  *  This library is distributed in the hope that it will be useful,
  36.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  37.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  38.  *  GNU Lesser General Public License for more details.
  39.  *
  40.  *  You should have received a copy of the GNU Lesser General
  41.  *  Public License along with this library; if not, write to the
  42.  *  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  43.  *  Boston, MA 02111-1307 USA
  44.  */
  45. class TreeNode extends TreeRoot
  46. {
  47.   /**
  48.    * @var    TreeRoot $parent 
  49.    * @access public
  50.    */
  51.   var $parent = null;
  52.   
  53.   
  54.   /**
  55.    * Constructor
  56.    */  
  57.   function TreeNode()
  58.   {}
  59.  
  60.  
  61.  
  62.   /**
  63.    * Adds a childnode of type TreeNode to this object.
  64.    *
  65.    * @version 1.0
  66.    * @since   0.1.0
  67.    * @author  Daniel Plücken <daniel@debakel.net>
  68.    * @access  public
  69.    * @param   TreeNode $obj_ref 
  70.    * @return  void 
  71.    */
  72.   function setParent&$obj_ref )
  73.   {
  74.     $this->parent =$obj_ref;
  75.     $obj_ref->addChild$this );
  76.   }
  77. // END of class TreeRoot
  78. ?>

Documentation generated on Thu, 05 Jun 2008 19:15:31 +0200 by phpDocumentor 1.4.1