Gets the number of nodes in this tree or subtree

This method is needed to fulfill the Countable interface.

@return integer the number of nodes in this tree or subtree.
962118
public function count()
    {
        $count = 1;
        foreach ($this->children as $child) {
            $count += count($child);
        }

        return $count;
    }
902435
public function getIsNode()
	{
		return ! is_null( $this->domNode ) && isset( DOMXPathNavigator::$nodeTypeMap[ $this->domNode->nodeType ] );
	}
522535
protected function objectCount()
    {
        $topNodeArray = eZPersistentObject::fetchObjectList(
            eZContentObjectTreeNode::definition(),
            null,
            array( 'parent_node_id' => 1, 'depth' => 1 )
        );
        $subTreeCount = 0;
        foreach ( array_keys ( $topNodeArray ) as $key  )
        {
            $subTreeCount += $topNodeArray[$key]->subTreeCount( array( 'Limitation' => array(), 'MainNodeOnly' => true ) );
        }

        return $subTreeCount;
    }
1371997
public function count()
    {
        return ( self::$assigned[$this->type] - self::START_AT + self::INCREMENT ) / self::INCREMENT;
    }
235412
public function count()
    {
        if ($this->countCached === null) {
            $pageSize = $this->pageSize;
            $this->pageSize = 1;
            $this->makeQuery(1);
            $this->pageSize = $pageSize;
        }

        return $this->countCached;
    }
558224
public int getLength()
  {

    // It is assumed that the getChildNodes call synchronized
    // the children. Therefore, we can access the first child
    // reference directly.
    int count = 0;

    for (ElemTemplateElement node = m_firstChild; node != null;
            node = node.m_nextSibling)
    {
      count++;
    }

    return count;
  }
1073286
public function getCount () {
        if ($this->_count === null) {
            $this->_count = $this->getConnection ()->getSlave ()->zcard ($this->name);
        }
        return $this->_count;
    }
731800
public function getStart() : int {
        $child = $this->getChildNodesAndTokens()->current();
        if ($child instanceof Node) {
            return $child->getStart();
        } elseif ($child instanceof Token) {
            return $child->start;
        }
        throw new \Exception("Unknown type in AST");
    }
1363022
public function countNodes()
	{
		$nodes = 1;
		if( $this->left || $this->right )
		{
			if( $this->left )
				$nodes += $this->left->countNodes();
			if( $this->right )
				$nodes += $this->right->countNodes();
		}
		return $nodes;
	}
995438
function() {
        for (var i = 0, count = 0;i< this.children.length;i++) {
            count += this.children[i].getNodeCount();
        }
        return count + 1;
    }
262838
public function getNumberOfChildNodes($nodeTypeFilter = null): int
    {
        return $this->nodeData->getNumberOfChildNodes($nodeTypeFilter, $this->context->getWorkspace(), $this->context->getDimensions());
    }
648767
def count_nodes(self):
        
        count = 1
        if self.left_node:
            count += self.left_node.count_nodes()
        if self.right_node:
            count += self.right_node.count_nodes()
        return count
1015113
public function getNodeTypeName()
    {
        return $this->nodeTypeName ?:
            (is_null($this->getNodeType()) ? null : $this->getNodeType()->getName());
    }
1126438
public function count(): ?int
    {
        // no where, count all simply
        $where = $this->query['where'] ?? null;
        if ($where == null) {
            return $this->agent->count($this->table);
        }

        $from = '';
        if ($this->query) {
            $isSub = $this->isSub;
            $this->isSub = true;
            $from = $this->toString();
            $this->isSub = $isSub; // restore
        }

        if ($from == '') {
            $from = "SELECT 1 FROM {$this->table} ". trim($this->toQueryString('where', false));
        }
        $from = trim($from);

        $query = "SELECT count(*) AS count FROM (\n\t{$from}\n) AS tmp";
        $result = $this->agent->get($query, null, 'object');

        return isset($result->count) ? intval($result->count) : null;
    }
1096373
public function count()
    {
        if ($this->meta['count'] !== null)
            return $this->meta['count'];

        if (empty($this->raw_data)) {
            $this->meta['count'] = 0;
        }
        else {
            $this->meta['count'] = 1 + substr_count($this->raw_data, self::SEPARATOR_ELEMENT);
        }

        if (!$this->meta['count'])
            $this->meta['messages'] = 0;

        return $this->meta['count'];
    }
1031240
public function numberOfChildren(): int
    {
        if (preg_match('/\n1 NCHI (\d+)(?:\n|$)/', $this->gedcom(), $match)) {
            return (int) $match[1];
        }

        $children = [];
        foreach ($this->spouseFamilies() as $fam) {
            foreach ($fam->children() as $child) {
                $children[$child->xref()] = true;
            }
        }

        return count($children);
    }
1182227
public function getDepth(){

        if($this->depth === NULL){

            if($this->isRootNode()){
                $this->depth = -1;
            }
            else{
                $parents = [$this];
                $node = $this;
                while($parent = $node->parentNode()){
                    if(!$parent->isRootNode()){
                        $parents[] = $parent;
                    }
                    $node = $parent;
                }
                $this->depth = count($parents);
            }
        }

        return $this->depth;
    }