TreemapNode::getSize PHP Method

getSize() public method

Gets the number of immediate child edges from this node.
public getSize ( )
    public function getSize()
    {
        return count($this->_children);
    }

Usage Example

 function testGraphDepthSpread()
 {
     $root = new TreemapNode("root", "test");
     $root->putChild(new TreemapNode("child", "test"));
     $childOne = new TreemapNode("child1", "test");
     $childTwo = new TreemapNode("child2", "test");
     $childThree = new TreemapNode("child3", "test");
     $childFour = new TreemapNode("child4", "test");
     $childFive = new TreemapNode("child5", "test");
     $childSix = new TreemapNode("child6", "test");
     $childFour->putChild($childFive);
     $childFour->putChild($childSix);
     $this->assertEqual($childFour->getSize(), 2);
     $this->assertEqual($childFour->getTotalSize(), 2);
     $childThree->putChild($childFour);
     $this->assertEqual($childThree->getSize(), 1);
     $this->assertEqual($childThree->getTotalSize(), 3);
     $childTwo->putChild($childThree);
     $this->assertEqual($childTwo->getSize(), 1);
     $this->assertEqual($childTwo->getTotalSize(), 4);
     $childOne->putChild($childTwo);
     $root->putChild($childOne);
     $this->assertEqual($root->getSize(), 2);
     $this->assertEqual($root->getTotalSize(), 7);
 }
All Usage Examples Of TreemapNode::getSize