Returns the number of its direct and indirect children.
 This is useful when we remove the reference to a subsegment
 and need to keep remaining subsegment size accurate.
518708
def all_children_count
      size = subsegments.count
      subsegments.each { |v| size += v.all_children_count }
      size
    end
886992
public function getSumChildCount(): int
    {
        $count = count($this->children);

        foreach ($this->children as $node) {
            $count += $node->getChildCount();
        }

        return $count;
    }
1331186
public function get_children_count() {
        $sortedids = self::get_tree($this->id);
        $invisibleids = $this->get_not_visible_children_ids();
        return count($sortedids) - count($invisibleids);
    }
649345
def getIndexedLength(self) :
		""""""
		if self.x1 != None and self.x2 != None:
			return self.x2 - self.x1
		else :
			if len(self.children) == 0 :
				return 0
			else :
				l = self.children[0].x2 - self.children[0].x1
				for i in range(1, len(self.children)) :
					l += self.children[i].x2 - self.children[i].x1 - max(0, self.children[i-1].x2 - self.children[i].x1)
				return l
121796
private int compareToVersionNumber(VersionIdentifier otherVersion) {

    // Example version: 1.2.3.4
    // Direct successors: 1.2.3.5 / 1.2.4[.0] / 1.3.[.0[.0]] / 2.[.0[.0[.0]]]
    // Direct predecessors: 1.2.3.3[.*]
    boolean equivalent = true;
    int result = 0;
    int maxSegmentCount = StrictMath.max(getVersionSegmentCount(), otherVersion.getVersionSegmentCount());
    for (int i = 0; i < maxSegmentCount; i++) {
      int segment = getVersionSegment(i);
      int otherSegment = otherVersion.getVersionSegment(i);
      if (segment != otherSegment) {
        int delta = segment - otherSegment;
        if (equivalent) {
          result = delta;
        } else {
          if (result == COMPARE_TO_STRICT_SUCCESSOR) {
            if (segment != 0) {
              result++;
              break;
            }
          } else if (result == COMPARE_TO_STRICT_PREDECESSOR) {
            if (otherSegment != 0) {
              result--;
              break;
            }
          }
        }
      }
    }
    return result;
  }
1136778
def get_children_to_delete(self):
        
        refobjinter = self.get_refobjinter()
        children = self.get_all_children()

        todelete = []
        for c in children:
            if c.status() is None:
                # if child is not in scene we do not have to delete it
                continue
            rby = refobjinter.referenced_by(c.get_refobj())
            if rby is None:
                # child is not part of another reference.
                # we have to delete it for sure
                todelete.append(c)
                continue
            # check if child is referenced by any parent up to self
            # if it is not referenced by any refrence of a parent, then we
            # can assume it is referenced by a parent of a greater scope,
            # e.g. the parent of self. because we do not delete anything above self
            # we would have to delete the child manually
            parent = c.get_parent()
            while parent != self.get_parent():
                if refobjinter.get_reference(parent.get_refobj()) == rby:
                    # is referenced by a parent so it will get delted when the parent is deleted.
                    break
                parent = parent.get_parent()
            else:
                todelete.append(c)
        return todelete
894961
@Synchronized
    public int getNumberOfSegments() {
        return assignedSegments.values().stream().mapToInt(Map::size).sum() + unassignedSegments.size();
    }
236890
public int getChildCount()
    {
        if(!m_bHasLoaded)
        {
            NodeData data = (NodeData)this.getUserObject();
            if ((data == null) || (!data.isLeaf()))
                this.loadChildren();
        }
        return super.getChildCount();
    }
683726
int getLineCount() {
       
        if ( lineCount > -1 ) return lineCount;
        
        lineMetrics.clear();
        double totLines = 0.0, prevMinY = 1.0, prevMaxY = -1.0;
        int totCharSoFar = 0;

        for ( Node n : children ) {
           
            Bounds nodeBounds = n.getBoundsInParent();
            int length = (n instanceof Text) ? ((Text) n).getText().length() : 1;
            PathElement[] shape = flow.rangeShape( totCharSoFar, totCharSoFar+length );
            double lines = Math.max( 1.0, Math.floor( shape.length / 5 ) );
            double nodeMinY = Math.max( 0.0, nodeBounds.getMinY() );
            
            if ( nodeMinY >= prevMinY && lines > 1 )  totLines += lines - 1;  // Multiline Text node 
            else if ( nodeMinY >= prevMaxY )  totLines += lines;

            if ( lineMetrics.size() < totLines ) {                            // Add additional lines
               
                if ( shape.length == 0 ) {
                   lineMetrics.add( new TextFlowSpan( totCharSoFar, length, nodeMinY, nodeBounds.getWidth(), nodeBounds.getHeight() ) );
                    totCharSoFar += length;
                }
                else for ( int ele = 1; ele < shape.length; ele += 5 ) {
                    // Calculate the segment's line's length and width up to this point
                    LineTo eleLine = (LineTo) shape[ele];
                    double segWidth = eleLine.getX(), lineMinY = eleLine.getY();
                    double charHeight = ((LineTo) shape[ele+1]).getY() - lineMinY;
                    Point2D endPoint = new Point2D( segWidth-1, lineMinY + charHeight / 2 );

                    // hitTest queries TextFlow layout internally and returns the position of the
                    // last char (nearest endPoint) on the line, irrespective of the current Text node !
                    int segLen = flow.hitTest( endPoint ).getCharIndex();
                    segLen -= totCharSoFar - 1;

                    if ( ele == 1 && nodeMinY < prevMaxY ) {
                        adjustLineMetrics( segLen, segWidth - ((MoveTo) shape[ele-1]).getX(), charHeight );
                    }
                    else {
                       lineMetrics.add( new TextFlowSpan( totCharSoFar, segLen, lineMinY, segWidth, charHeight ) );
                    }

                    totCharSoFar += segLen;
                }
            }
            else {
                // Adjust current line metrics with additional Text or Node embedded in this line 
                adjustLineMetrics( length, nodeBounds.getWidth(), nodeBounds.getHeight() );
                totCharSoFar += length;
            }

            prevMaxY = nodeBounds.getMaxY();
            prevMinY = nodeMinY;
        }
        
        lineCount = (int) totLines;
        return lineCount;
    }
578983
public int getTotalStepCountWithDescendants() {
        int descendantCount = isStepMacro() ? 0 : 1;
        for ( StepToken c : childSteps) {
            descendantCount += c.getTotalStepCountWithDescendants();
        }
        return descendantCount;
    }
260106
def children_not_empty(self):
        
        children = []
        for child_node in self.fragments_tree.children_not_empty:
            child_text_file = self.get_subtree(child_node)
            child_text_file.set_language(child_node.value.language)
            children.append(child_text_file)
        return children
1368239
public int getLength() {
        int count=0;
        for (int handle=m_firstChild;
             handle!=DTM.NULL;
             handle=m_parentDTM.getNextSibling(handle)) {
            ++count;
        }
        return count;
    }
381632
int size() {
        int res = m_subscriptions.size();
        for (TreeNode child : m_children) {
            res += child.size();
        }
        return res;
    }
1027826
public int numberOfElements() {
        int n = 0;
        for (SortedSet<Integer> cell : cells) {
            n += cell.size();
        }
        return n;
    }
1328440
public int getNumberOfPredecessors() {

		int numberOfPredecessors = 0;

		for (int i = 0; i < this.inputGates.length; ++i) {
			numberOfPredecessors += this.inputGates[i].getNumberOfEdges();
		}

		return numberOfPredecessors;
	}
1272997
def child_count(self, path):
        
        stat = self.stat(path)
        if not stat:
            return 0

        count = stat.numChildren
        for _, _, stat in self.tree(path, 0, include_stat=True):
            if stat:
                count += stat.numChildren
        return count
534939
public int size() {
        int size = 0;
        try {
            if (getParent() != null) {
                size = getParent().locateChildElements(getLocator()).size();
            } else {
                size = HtmlElementUtils.locateElements(getLocator()).size();
            }
        } catch (NoSuchElementException e) { // NOSONAR
            // do nothing, let size be returned as 0
        }

        return size;
    }