Author: dr
Date: Wed Jul 25 09:47:59 2007
New Revision: 5729
Log:
- More updates after comments.
Modified:
experimental/Tree/design/class_diagram.png
experimental/Tree/design/design.txt
Modified: experimental/Tree/design/class_diagram.png
==============================================================================
Binary files - no diff available.
Modified: experimental/Tree/design/design.txt
==============================================================================
--- experimental/Tree/design/design.txt [iso-8859-1] (original)
+++ experimental/Tree/design/design.txt [iso-8859-1] Wed Jul 25 09:47:59 2007
@@ -98,10 +98,18 @@
public function fetchPath( $id );
Returns all the nodes in the path from the root node to the node with ID
$id, including those two nodes.
-public function fetchSubtree( $id, $searchMethod = ezcTree::DEPTH_FIRST );
- Returns the node with ID $id and all it's children, the order depends on
- the search method. See "Sorting_" for more information on the supported
- algorithms.
+public function fetchSubtreeBreadthFirst( $id );
+ Returns the node with ID $id and all it's children, sorted accoring to
the
+ `Breadth-first sorting`_ algorithm.
+public function fetchSubtreeDepthFirst( $id );
+ Returns the node with ID $id and all it's children, sorted accoring to
the
+ `Depth-first sorting`_ algorithm.
+public function fetchSubtreeTopological( $id );
+ Returns the node with ID $id and all it's children, sorted accoring to
the
+ `Topological sorting`_ algorithm.
+public function fetchSubtree( $id );
+ Alias for fetchSubtreeDepthFirst().
+
Information querying methods
____________________________
@@ -112,7 +120,7 @@
Returns the number of children of the node with ID $id, recursively
public function getPathLength( $id );
Returns the distance from the root node to the node with ID $id
-public function hasChildren( $id );
+public function hasChildNodes( $id );
Returns whether the node with ID $id has children
public function isChildOf( $childId, $parentId );
Returns whether the node with ID $childId is a direct child of the node
@@ -385,9 +393,9 @@
$tree->isChildOf( '2', '1' );
// checking whether a node has children, and how many:
- $tree->fetchNodeById( '1' )->hasChildren();
+ $tree->fetchNodeById( '1' )->hasChildNodes();
$tree->fetchNodeById( '1' )->getChildCount();
- $tree->hasChildren( '3' );
+ $tree->hasChildNodes( '3' );
$tree->getChildCount( '3' );
// fetching a subtree:
@@ -425,8 +433,8 @@
algoritms can be used with the fetchSubtree() method (specified in the 2nd
parameter).
-Breath-first sorting
-~~~~~~~~~~~~~~~~~~~~
+Breadth-first sorting
+~~~~~~~~~~~~~~~~~~~~~
Returns the subtree in the order of distance to the root node. See
`Breadth-first search <http://en.wikipedia.org/wiki/Breadth-first_search>`_ for
@@ -439,8 +447,8 @@
`Depth-first search <http://en.wikipedia.org/wiki/Depth-first_search>`_ for
more information on the algorithm.
-_`Topological Sorting`
-~~~~~~~~~~~~~~~~~~~~~~
+Topological Sorting
+~~~~~~~~~~~~~~~~~~~
A sorting method that can sort the information in a tree in such a way that the
leaf nodes are on top. See: http://en.wikipedia.org/wiki/Topological_sorting
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components