Source for file TreeNode.interface.php

Documentation is available at TreeNode.interface.php

  1. <?php
  2.  
  3. /**
  4. * This is the building piece of the Tree data structure used for the backbone of the
  5. * hierarchy.
  6. *
  7. * @package harmoni.osid_v2.hierarchy.tree
  8. *
  9. * @copyright Copyright &copy; 2005, Middlebury College
  10. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  11. *
  12. * @version $Id: TreeNode.interface.php,v 1.7 2007/09/04 20:25:42 adamfranco Exp $
  13. * @since Created: 8/30/2003
  14. */
  15. class TreeNodeInterface {
  16.  
  17. /**
  18. * Adds a new child for this node.
  19. * @access public
  20. * @param ref object child The child node to add.
  21. * @return void
  22. */
  23. function addChild($child) {
  24. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  25. }
  26. /**
  27. * Detaches the child from this node. The child remains in the hierarchy.
  28. * @access public
  29. * @param ref object child The child node to detach.
  30. * @return void
  31. ***/
  32. function detachChild($child) {
  33. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  34. }
  35. /**
  36. * Returns the parent node of this node.
  37. * @access public
  38. * @return ref array The parent nodes of this node.
  39. */
  40. function getParents() {
  41. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  42. }
  43.  
  44. /**
  45. * Returns the number of parents for this node.
  46. * @access public
  47. * @return integer The number of parents for this node.
  48. */
  49. function getParentsCount() {
  50. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  51. }
  52.  
  53.  
  54. /**
  55. * Determines if this node has any parents.
  56. * @access public
  57. * @return boolean <code>true</code> if this node has at least one parent;
  58. * <code>false</code>, otherwise.
  59. */
  60. function hasParents() {
  61. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  62. }
  63.  
  64.  
  65. /**
  66. * Returns the children of this node in the order they were added.
  67. * @access public
  68. * @return ref array An array of the children nodes of this node.
  69. */
  70. function getChildren() {
  71. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  72. }
  73. /**
  74. * Returns the number of children for this node.
  75. * @access public
  76. * @return integer The number of children for this node.
  77. */
  78. function getChildrenCount() {
  79. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  80. }
  81. /**
  82. * Determines if this node has any children.
  83. * @access public
  84. * @return boolean <code>true</code> if this node has at least one child;
  85. * <code>false</code>, otherwise.
  86. */
  87. function hasChildren() {
  88. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  89. }
  90. /**
  91. * Checks if the given node is a child of this node.
  92. * @access public
  93. * @param ref object node The child node to check.
  94. * @return boolean <code>true</code> if <code>$node</code> is a child of this node.
  95. ***/
  96. function isChild($node) {
  97. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  98. }
  99. /**
  100. * Checks if the given node is a parent of this node.
  101. * @access public
  102. * @param ref object node The child node to check.
  103. * @return boolean <code>true</code> if <code>$node</code> is a parent of this node.
  104. ***/
  105. function isParent($node) {
  106. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  107. }
  108. /**
  109. * Returns the id of this node.
  110. * @access public
  111. * @return string The id of this node.
  112. */
  113. function getId() {
  114. die ("Method <b>".__FUNCTION__."()</b> declared in interface<b> ".__CLASS__."</b> has not been overloaded in a child class.");
  115. }
  116. }
  117.  
  118. ?>

Documentation generated on Wed, 19 Sep 2007 10:27:34 -0400 by phpDocumentor 1.3.0RC3