Difference between revisions of "SHIP:Sail:getChildCount"

From Serious Documentation
Jump to: navigation, search
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
See Also:
+
{{SailFuncTableStart|}}<onlyinclude>
*[[SHIP:Sail|SHIP Sail Home]]
+
|{{SailFunc|getChildCount}}||{{DataType|String}}||1||Gets a count of the total number of child {{DataType|Node}}s within an enclosing parent {{DataType|Node}}.</onlyinclude>
*[[SHIP:Sail:Functions|SHIP Sail Function Home]]
+
|}
*[[SHIP:Sail:getChild |getChild()]],[[SHIP:Sail:getChildIndex|getChildIndex()]]
+
== See Also: ==
 
+
*[[SHIP:Sail|Sail Home]]
== getChildCount ==
+
*[[SHIP:Sail:Functions|Sail Functions]]
Gets a count of the total number of child nodes within an enclosing parent node.
+
*[[SHIP:Sail:Node Functions|Sail Node Functions]]
 +
*{{SailFunc|getChild}}, {{SailFunc|getChildIndex}}
  
 
== Prototype ==
 
== Prototype ==
<code>{{DataType|Integer}} getChildCount({{DataType|Reference}}:[[SHIP:Node|node]] parentNode);</code>
+
<code>{{DataType|Integer}} {{SailFunc|getChildCount}}({{DataType|Node}} parentNode);</code>
 
 
 
=== Parameters/Return Value ===
 
=== Parameters/Return Value ===
 
{| class="wikitable" style="margin: 1em 1em;"  
 
{| class="wikitable" style="margin: 1em 1em;"  
Line 17: Line 17:
 
! scope="col" style="text-align:left" | Description
 
! scope="col" style="text-align:left" | Description
 
|-
 
|-
|parentNode||{{DataType|Reference}}:[[SHIP:Node|node]]||The node to look in for children
+
|parentNode||{{DataType|Reference}}:[[SHIP:Node|node]]||The {{DataType|Node}} to look in for children
 
|-
 
|-
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | Return
 
! scope="col" style="text-align:left" | {{DataType|Integer}}
 
! scope="col" style="text-align:left" | {{DataType|Integer}}
! scope="col" style="text-align:left" | number of direct children within the parent node
+
! scope="col" style="text-align:left" | number of direct children within the parent {{DataType|Node}}
 
|}
 
|}
 
 
== Detailed Description ==
 
== Detailed Description ==
 +
The {{SailFunc|getChildCount}} function returns the number of direct children within the parent.
  
The <code>getChildCount(parent)</code> function returns the number of direct children within the parent.
+
Nodes in [[SHIP]] may have 0 or more direct child nodes.  For example, a {{Node|group}} in the {{Node|resources}} area may have N {{Node|image}}s within the {{Node|group}}. These children, if present, are implicitly numbered <code>0..(N-1)</code> where <code>N</code> is the total number of children of any type within the parent {{DataType|Node}}.
 
 
Nodes in [[SHIP]] may have 0 or more direct child nodes.  For example, a {{Node|group}} in the {{Node|resources}} area may have N {{Node|image}}s within the {{Node|group}}. These children, if present, are implicitly numbered <code>0..(N-1)</code> where <code>N</code> is the total number of children of any type within the parent node.
 
  
 
== Examples ==
 
== Examples ==

Revision as of 05:16, 14 July 2014

Function Returns Introduced Description
getChildCount String 1 Gets a count of the total number of child Nodes within an enclosing parent Node.

See Also:

Prototype

Integer getChildCount(Node parentNode);

Parameters/Return Value

Parameter Data Type Description
parentNode Reference:node The Node to look in for children
Return Integer number of direct children within the parent Node

Detailed Description

The getChildCount function returns the number of direct children within the parent.

Nodes in SHIP may have 0 or more direct child nodes. For example, a group in the resources area may have N images within the group. These children, if present, are implicitly numbered 0..(N-1) where N is the total number of children of any type within the parent Node.

Examples